Thursday 15 September 2011

Writing anonymous function in jQuery animation -


Please help me write an anonymous function in the animation, the code I have tried, it is here Anonymous in Animation How to write functions, such as in the CSS button click, thanks in advance

  & lt; Html & gt; & Lt; Top & gt; & Lt; Title & gt; & Lt; / Title & gt; & Lt; Meta http-equiv = "content-type" content = "text / html; charset = UTF-8" & gt; & Lt; Script src = "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" & gt; & Lt; / Script & gt; & Lt; Style type = "text / css" & gt; #example {width: 100px; Height: 100px; Background: # F00;} & lt; / Style & gt; & Lt; Script & gt; $ (Document) .ready (function () {$ ('# check'). Click (function () {$ ('# example'). CSS ({width: function () {console.log ($ (this ($) ($) ($) ($) ($) () $ ('# Example'). Animate ({width: function () {console.log ($ (this). Width ()); Return $ (this). Width () == "0"? "100": "0";}});})}}; & lt; / scripts & gt; & lt; / head & gt; Lt; body & gt; div id = "example" & gt; & lt; / div & gt; & lt; input type = "button" value = "css" id = "check" /> Lt; input type = "button" value = "animated" id = "animate" />     

  $ ('# animate') .click (function () {$ ('# example '). Chetan ({ Width: (function ($ self) {console.log ($ self.width ()); return $ self.width () == "0"? "100": "0";}) ($ ('# example '))}});});    

No comments:

Post a Comment