jquery(html, attributes) in attributes calling function off of -


There is a note in it which says:

In the form of jQuery 1.8, any jQuery frequency method (A method of jquery.fn can be used as a property of an object passed to another parameter

I feel that the function can be called multiple times in many ways but given The example () method is applied once and many events do not show whether someone can tell me a more complicated example or I ?

According to what I have seen, to make this just an example, it means that You can pass all the properties in the form of the following parameters:

  $ ("

", {"class": "my- Click on "class", "text": "This is an exam", function: () {$ (this) .css ('color', '(' color ',' red ');}, mouseout: function } {$ (This). CSS ('color', 'green');}}). Annex ("body");

This is another way of doing this: / P>

  $ ("& lt; P & gt; & Lt; / P & gt; ") .addClass (" ("This is also an exam"). (Function () {$ (this) .css ('color', 'blue');}) .mouseenter (function (); $ (This) .css ('color', 'red');}) .mouseout (function () {$ (this) .css ('color', 'green');}) .appendTo (" Body "); The page says:" The second argument is logical, but due to its flexibility there may be unexpected results (such as $ (", {size:" 4 "}.) Instead of setting the characteristic size) . "

It is good to know the different forms of doing the same thing, but I will continue to use the other :)

JSFiddle with the examples given above:

< / Div>

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -