ready to usmore easily to

请帮我总结一下这几道英语题目的语法点1.People need to use water for bathing and washing clothes.(为什么用bathing,而不用bath)2.Your clothes will get clean more easily if you wash them under running water.(为什么用easily,而不用easy)3.People living near the sea can use as much water as they like.(为什么用living,不用live)4.i begin to learn to raise (as many questions)as i can in maths classes.(为什么是as many questions,而不是questions as many)5.Every student should (listen to )the rules.Which of the following words is not accepted?(为什么用listen to ,不用obey)6.Boys and girls!It's time for you to get (cleaned up)(为什么用cleaned up,不用cleaning up)
1.People need to use water for bathing and washing clothes.(为什么用bathing,而不用bath)for 是介词,后面要名词,所以用了动名词 bathing至於 bath也是名词,但这里要用 bath,便要加上 a,即 a bath2.Your clothes will get clean more easily if you wash them under running water.(为什么用easily,而不用easy)easily 是形容原句中动词 clean,所以要副词3.People living near the sea can use as much water as they like.(为什么用living,不用live)living near the sea是形容词短语,形容people如果用 live,原句便有2个动词,在这里语法上是错误的4.i begin to learn to raise (as many questions)as i can in maths classes.(为什么是as many questions,而不是questions as many)这是 as ...as的用法5.Every student should (listen to )the rules.Which of the following words is not accepted?(为什么用listen to ,不用obey)这2词,我会选obey为什麼用listen to,我不知道不过,要留意问句Which of the following words is not accepted?所指的是不可以接受如果 listen to 是答案这便对了因为 listen to 不可以接受6.Boys and girls!It's time for you to get (cleaned up)(为什么用cleaned up,不用cleaning up) 指本身个人的清洁
为您推荐:
其他类似问题
1 for 是介词
后加动词ing 2 easily 修饰动词clean应该用副词 而不是形容词3 动名词作定语 而原形不能 不好意思下面的说不好了
扫描下载二维码Get Started
A powerful, flexible jQuery plugin enabling you to easily create semantic, modern tooltips enhanced with the power of CSS.
Hover Default settings
Hover Fixed width, position, & HTML
Click Custom show / hide triggers
Hover Disable touch devices
Hover Custom themes & animations
Hover Custom callbacks (AJAX <3)
Hover Interaction with tooltips
Attach tooltips to icons
Hover Multiple tooltips on a single element
...& more!
Getting Started
1. Load jQuery and include Tooltipster's plugin files
After you , move tooltipster.css and jquery.tooltipster.min.js to your root's CSS and JavaScript directories. Next, load jQuery and include Tooltipster's CSS and JavaScript files inside of your
&head&#62;
&link rel="stylesheet" type="text/css" href="css/tooltipster.css" /&#62;
&script type="text/javascript" src="/jquery-1.7.0.min.js"&#62;&/script&#62;
&script type="text/javascript" src="js/jquery.tooltipster.min.js"&#62;&/script&#62;
&/head&#62;
2. Set up your HTML
In order for Tooltipster to work, we first need to add the .tooltip class (or whatever class / means of selection you'd like to use) to whatever element we wish to have a tooltip. Next, we'll set the title attribute to whatever we'd like our tooltip to say. Here are a few examples:
Adding a tooltip to an image:
&img src="my-image.png" class="tooltip" title="This is my image's tooltip message!" /&#62;
Adding a tooltip to a link that already has a class:
&a href="" class="ketchup tooltip" title="This is my link's tooltip message!"&#62;Link&/a&#62;
Adding a tooltip to a div:
&div class="tooltip" title="This is my div's tooltip message!"&#62;
This div has a tooltip when you hover over it!
&/div&#62;
3. Activate Tooltipster
The last thing we have to do is activate the plugin. To do this, add the following script right before your closing &/head&#62; tag (using whatever selector you'd like - in this case we're using the .tooltip class):
&head&#62;
&script&#62;
$(document).ready(function() {
$('.tooltip').tooltipster();
&/script&#62;
&/head&#62;
Using HTML tags inside your tooltips
Tooltipster allows you to use any HTML markup you can think of inside your tooltips. This means you can insert things like images and text formatting tags. To achieve this, the recommended method is a little different : provide your content as a jQuery object in the script rather than in the title attribute :
&head&#62;
&script&#62;
$(document).ready(function() {
$('#my-tooltip').tooltipster({
content: $('&span&&img src="my-image.png" /& &strong&This text is in bold case !&/strong&&/span&')
&/script&#62;
&/head&#62;
&body&#62;
&div id="my-tooltip"&#62;
This div has a tooltip with HTML when you hover over it!
&/div&#62;
&/body&#62;
Another (less recommended) way of achieving this is to put encoded HTML markup directly in your title attribute and set the 'contentAsHTML' option to 'true'. In all cases, make sure you have tight control over the content you wish to display in the tooltip, as unwanted &script& or &iframe& tags for example would be a serious security issue for your website.
&head&#62;
&script&#62;
$(document).ready(function() {
$('.tooltip').tooltipster({
contentAsHTML: true
&/script&#62;
&/head&#62;
&body&#62;
&div class="tooltip" title="&img src=&my-image.png& /& &strong& This text is in bold case !&/strong&"&
This div has a tooltip with HTML when you hover over it!
&/div&#62;
&/body&#62;
Customizing Your Tooltipster's Style
The style of your Tooltipsters can be easily changed by editing/overriding the default Tooltipster theme, located in the css/tooltipster.css file.
Tooltipster is also packaged with 4 alternative themes to choose from. They are demonstrated at the bottom of this page. To use a theme, just include its css file (located in the css/themes folder) in your page and specify its name in Tooltipster's settings :
$('.tooltip').tooltipster({
theme: 'tooltipster-noir'
And of course, you also have the option to create a brand new theme to suit your needs. To do this, start with the example below and add your flair. When you are done, include and specify your theme just like you would for one of Tooltipster's existing themes.
/* This is how you would create a theme called "my-custom-theme": */
.my-custom-theme {
border-radius: 5
border: 2px solid #000;
background: #4c4c4c;
/* Use this next selector to style things like font-size and line-height: */
.my-custom-theme .tooltipster-content {
font-family: Arial, sans-
font-size: 14
line-height: 16
padding: 8px 10
Customizing Tooltipster's Functionality
Tooltipster's options gives you a wide range of variables to tweak your tooltip to your heart's content. To learn more about all of the options, . Here's just a few of the things you can play with:
$('.tooltip').tooltipster({
animation: 'fade',
delay: 200,
theme: 'tooltipster-default',
touchDevices: false,
trigger: 'hover'
fade, grow, swing, slide, fall
Determines how the tooltip will animate in and out. Feel free to modify or create custom transitions in the tooltipster.css file. In IE9 and 8, all animations default to a JavaScript generated, fade animation. Default: 'fade'
Adds the "speech bubble arrow" to the tooltip. Default: true
arrowColor
hex code / rgb
Select a specific color for the "speech bubble arrow". Default: will inherit the tooltip's background color
If autoClose is set to false, the tooltip will never close unless you call the 'hide' method yourself. Default: true
string, jQuery object
If set, this will override the content of the tooltip. Default: null
contentAsHTML
If the content of the tooltip is provided as a string, it is displayed as plain text by default. If this content should actually be interpreted as HTML, set this option to true. Default: false
contentCloning
If you provide a jQuery object to the 'content' option, this sets if it is a clone of this object that should actually be used. Default: true
Tooltipster logs notices into the console when you're doing something you ideally shouldn't be doing. Set to false to disable logging. Default: true
Delay how long it takes (in milliseconds) for the tooltip to start animating in. Default: 200
Set a minimum width for the tooltip. Default: 0 (auto width)
Set a maximum width for the tooltip. Default: null (no max width)
functionInit
Create a custom function to be fired only once at instantiation. If the function returns a value, this value will become the content of the tooltip. See the
to learn more. Default: function(origin, content) {}
functionBefore
Create a custom function to be fired before the tooltip opens. This function may prevent or hold off the opening. See the
to learn more. Default: function(origin, continueTooltip) { continueTooltip(); }
functionReady
Create a custom function to be fired when the tooltip and its contents have been added to the DOM. Default: function(origin, tooltip) {}
functionAfter
Create a custom function to be fired once the tooltip has been closed and removed from the DOM. Default: function(origin) {}
hideOnClick
If true, the tooltip will close if its origin is clicked. This option only applies when 'trigger' is 'hover' and 'autoClose' is false. Default: false
string, jQuery object
If using the iconDesktop or iconTouch options, this sets the content for your icon. Default: '(?)'
iconCloning
If you provide a jQuery object to the 'icon' option, this sets if it is a clone of this object that should actually be used. Default: true
iconDesktop
Generate an icon next to your content that is responsible for activating the tooltip on non-touch devices. Default: false
If using the iconDesktop or iconTouch options, this sets the class on the icon (used to style the icon). Default: 'tooltipster-icon'
Generate an icon next to your content that is responsible for activating the tooltip on touch devices (tablets, phones, etc). Default: false
interactive
Give users the possibility to interact with the tooltip. Unless autoClose is set to false, the tooltip will still close if the user moves away from or clicks out of the tooltip. Default: false
interactiveTolerance
If the tooltip is interactive and activated by a hover event, set the amount of time (milliseconds) allowed for a user to hover off of the tooltip activator (origin) on to the tooltip itself - keeping the tooltip from closing. Default: 350
Allows you to put multiple tooltips on a single element. Read further instructions down this page. Default: false
Offsets the tooltip (in pixels) farther left/right from the origin. Default: 0
Offsets the tooltip (in pixels) farther up/down from the origin. Default: 0
If true, only one tooltip will be allowed to be active at a time. Non-autoclosing tooltips will not be closed though. Default: false
right, left, top, top-right, top-left, bottom, bottom-right, bottom-left
Set the position of the tooltip. Default: 'top'
positionTracker
Will reposition the tooltip if the origin moves. As this option may have an impact on performance, we suggest you enable it only if you need to. Default: false
positionTrackerCallback
Called after the tooltip has been repositioned by the position tracker (if enabled). Default: A function that will close the tooltip if the trigger is 'hover' and autoClose is false.
restoration
'none', 'previous' or 'current'
Specify if a TITLE attribute should be restored on the HTML element after a call to the 'destroy' method. This attribute may be omitted, or be restored with the value that existed before Tooltipster was initialized, or be restored with the stringified value of the current content. Note: in case of multiple tooltips on a single element, only the last destroyed tooltip may trigger a restoration. Default: 'current'
Set the speed of the animation. Default: 350
How long the tooltip should be allowed to live before closing. Default: 0 (disabled)
Set the theme used for your tooltip. Default: 'tooltipster-default'
touchDevices
If set to false, tooltips will not show on pure-touch devices, unless you open them yourself with the 'show' method. Touch gestures on devices which also have a mouse will still open the tooltips though. Default: true
hover, click, custom
Set how tooltips should be activated and closed. See the
to learn how to build custom triggers. Default: 'hover'
updateAnimation
If a tooltip is open while its content is updated, play a subtle animation when the content changes. Default: true
The awesomesauce Tooltipster API
The Tooltipster API was created to be as flexible and easy to use as possible (thanks to
for the inspiration). The API allows you to create custom triggers, update tooltip content on the fly (whether the tooltip is currently open or not), destroy Tooltipster functionality if needed, and reposition tooltips for unique use cases.
Here is a quick look at all of the API methods:
// set default options for all future tooltip instantiations
$.fn.tooltipster('setDefaults', {
position: 'bottom'
// show a tooltip (the 'callback' argument is optional)
$(...).tooltipster('show', callback);
// hide a tooltip (the 'callback' argument is optional)
$(...).tooltipster('hide', callback);
// temporarily disable a tooltip from being able to open
$(...).tooltipster('disable');
// if a tooltip was disabled from opening, reenable its previous functionality
$(...).tooltipster('enable');
// hide and destroy tooltip functionality
$(...).tooltipster('destroy');
// return a tooltip's current content (if selector contains multiple origins, only the value of the first will be returned)
$(...).tooltipster('content');
// update tooltip content
$(...).tooltipster('content', myNewContent);
// get the value of an option
$(...).tooltipster('option', optionName);
// set the value of an option (use at your own risk, we do not provide support for issues you may encounter when using this method)
$(...).tooltipster('option', optionName, optionValue);
// reposition and resize the tooltip
$(...).tooltipster('reposition');
// return the HTML root element of the tooltip
$(...).tooltipster('elementTooltip');
// return the HTML root element of the icon if there is one, 'undefined' otherwise
$(...).tooltipster('elementIcon');
Using AJAX to generate your tooltip content
Tooltipster gives you the ability to fire a custom synchronous or asynchronous function everytime before the tooltip launches () or just once upon instantiation (). One great use for this is to grab dynamic content for your tooltips via AJAX.
Here is an example of using functionBefore() asynchronously to replace a loading notification with our AJAX call. Once the content has been retrieved and updated, we'll take advantage of setting $.data() to keep our content cached for the next time the tooltip is opened:
$('.tooltip').tooltipster({
content: 'Loading...',
functionBefore: function(origin, continueTooltip) {
// we'll make this function asynchronous and allow the tooltip to go ahead and show the loading notification while fetching our data
continueTooltip();
// next, we want to check if our data has already been cached
if (origin.data('ajax') !== 'cached') {
type: 'POST',
url: 'example.php',
success: function(data) {
// update our tooltip content with our returned data and cache it
origin.tooltipster('content', data).data('ajax', 'cached');
However, maybe you just need to make one call and only need it to fire once instead of everytime the tooltip opens. This is where you could use functionInit(). This function will fire only once - right at the beginning of the instantiation process. You'll have the ability to do things like check the current content and set new content. Since the fancy API methods for returning and setting the value aren't instantiated yet, the way we go about this is a little different than functionBefore():
$('.tooltip').tooltipster({
functionInit: function(origin, content) {
if (content === 'This is bad content') {
// when the request has finished loading, we will change the tooltip's content
type: 'POST',
url: 'example.php',
success: function(data) {
origin.tooltipster('content', 'New content has been loaded : ' + data);
// this returned string will overwrite the content of the tooltip for the time being
return 'Wait while we load new content...';
// return nothing : the initialization continues normally with its content unchanged.
Manually show and hide a tooltip
By default and according to the 'trigger' option, Tooltipster automatically shows tooltips upon users' mouse clicks or mouse hovering (or their touch-gesture equivalents). In addition to this, you may also manually open or close a tooltip at anytime with a simple javascript command.
To achieve this, Tooltipster has the 'show' and 'hide' methods. Both of them may receive an optional 'callback' parameter, which represents a function you'd like to call when the tooltip is done animating.
Here's an example of how you could launch a specific tooltip on page load and close it when any key on your keyboard is pressed. This will still preserve the default hover trigger.
&span class="tooltip" id="example" title="My tooltip content"&#62;Example&/span&#62;
$(document).ready(function() {
// first on page load, initiate the Tooltipster plugin
$('.tooltip').tooltipster();
// then immediately show the tooltip
$('#example').tooltipster('show');
// as soon as a key is pressed on the keyboard, hide the tooltip.
$(window).keypress(function() {
$('#example').tooltipster('hide');
You may also provide a function as the callback parameter of the show/hide methods. The callback functions are called in the context of the tooltipstered element. If the tooltip is already in the state you are asking for (open/closed), the callback is executed immediately. Please note that if the show/hide action is somehow cancelled before it has completed its animation, the callback function will never be called.
$(document).ready(function() {
$('.tooltip').tooltipster();
$('#example').tooltipster('show', function() {
alert('The tooltip is now fully open. The content is: ' + this.tooltipster('content'));
$(window).keypress(function() {
$('#example').tooltipster('hide', function() {
alert('The tooltip is now fully closed');
Updating a tooltip's content
It's easy as pie to update a tooltip's content - whether it's open or closed. Depending on your selector, you can update multiple tooltips at once or just one:
$('#my-special-element').tooltipster('content', 'My new content');
By default, Tooltipster will play a subtle animation when the content changes. To tweak the animation, check out the '.tooltipster-content-changing' class in your tooltipster.css file. It's important to note that only CSS transforms will be animated. To disable this animation, set updateAnimation to false.
Using several tooltips on a single element
Several independant tooltips can be set on a single element, each one having its own triggers and options. Just set the 'multiple' option to true when you initialize your tooltip. This will only change two things that you might want to be aware of.
Firstly, the instantiation call will now return an array of Tooltipster objects generated by the call, instead of the tooltipped jQuery-wrapped elements.
Secondly, you will have to use the Tooltipster object of a tooltip to make any API method calls on it. All methods documented on this page remain available, only the way to call them changes.
// create a first tooltip as usual. The multiple option is actually optional for the first tooltip
$('#my-element').tooltipster({
content: 'My first tooltip',
position: 'top'
// instantiate a second tooltip and keep the returned Tooltipster objects array for later use of the API
var tooltipsterObjects = $('#my-element').tooltipster({
// don't forget to provide content here as the 1st tooltip will have deleted the original title attribute of the element
content: 'My second tooltip',
multiple: true,
position: 'bottom'
// since the jQuery selector matches only one element, the array will contain only one Tooltipster object.
// Otherwise the array would contain one object for each matched element, in the same order as them
var tooltip2 = tooltipsterObjects[0];
// use this Tooltipster object to make any API method call on the tooltip
tooltip2.content('New content for my second tooltip').show();
// all documented methods can be called that way
var element = tooltip2.elementTooltip();
// calling the API methods in the usual way only affects the first tooltip that was created on the element
$('#my-element').tooltipster('content', 'New content for my first tooltip')
// You may use the 'multiple' option on the first tooltip as well, it will return an array of objects too
var tooltipsterObjects = $('#my-element').tooltipster({
content: 'My first tooltip',
multiple: true
// this is also a way to call API methods on the first tooltip
var tooltip1 = tooltipsterObjects[0];
tooltip1.content('New content for my first tooltip').show();
Note : if you have multiple tooltips and destroy them, only the last destroyed tooltip will transfer its content back to the title attribute of the tooltipped element.
Make tooltips accessible to persons with disabilities
The W3C issued a recommendation to make websites more accessible to persons with disabilities. This recommendation is known as WAI-ARIA (or simply ARIA), which stands for Web Accessibility Initiative - Accessible Rich Internet Applications.
Accessible tooltips can be powered by Tooltipster. To do this, one solution is to actually manipulate in parallel two tooltips which will share the same content :
- the ARIA tooltip, which is invisible on the screen but readable by ARIA-compatible software
- the Tooltipster tooltip, which is visible on the screen but does not appear as an ARIA-compatible element
A basic example : imagine that we want to put a tooltip on a text input field. As for the HTML part, you would write :
&input id="myfield" type="text" aria-describedby="myfield_description" /&
&span id="myfield_description" role="tooltip"&Please insert your name here&/span&
As for the CSS part, write this :
#myfield_description {
And finally, you could initiate Tooltipster like this :
$('#myfield').tooltipster({
functionInit: function(){
return $('#myfield_description').html();
functionReady: function(){
$('#myfield_description').attr('aria-hidden', false);
functionAfter: function(){
$('#myfield_description').attr('aria-hidden', true);
// if in addition you want the tooltip to be displayed when the field gets focus, add these custom triggers :
$('#myfield')
.focus(function(){
$(this).tooltipster('show');
.blur(function(){
$(this).tooltipster('hide');
Community submitted use cases
Did you do something awesome with Tooltipster?
and I'll post it up here!
Tired of the same old? Four other rocking themes are available for your tooltips, and you can always create yours ! Share them with us on GitHub !
Share thoughts, questions, & bugs!
Head on over to Tooltipster's issue tracker on GitHub:
Before opening a new issue, please be sure to search through the backlog to see if your question or bug has been / is being resolved. Thank you! :)
Developed and maintained by

我要回帖

更多关于 ready to use 的文章

 

随机推荐