简体   繁体   中英

jQuery animate table from json2html transform

I cannot animate with CSS3 because the properties are not yet standard across browsers.

I can create a div table with json2html.

I can animate a row by setting {height:(toggle)?'show':'hide', opacity: (toggle)?1:0}, function(){ $(this).css('display', (toggle)?'auto':'none').css('height', ) } with jQuery to make rows appear and disappear.

What I cannot do is put them together. I've seen the json2html examples (Examples->jquery) , and they apply functions, but even if I understood how the functions are being applied, I'd still have no idea how to incorporate animate.

How can jQuery $.aniamte() be called on a json2html constructed element from a json2html transform?

Figure this is a little old but worth commenting on ..

json2html maps attributes with the starting characters "on" to events, so

onclick -> jquery event "click" onfocus -> jquery event "focus"

which uses the function $.on( event,...) to register the event. This means you can use any event that $.on() recognizes. For more documentation on $.on()

Since strictly speaking $.animate isn't an event, but rather a jquery function you won't be able to use it with the json2html.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM