0

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?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

1 Answers1

1

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.

Chad Brown
  • 1,627
  • 1
  • 13
  • 22
  • Yep, should've deleted this after your awesome primer on `eventData` http://stackoverflow.com/questions/22313664/json2html-eventdata-example –  Mar 25 '14 at 19:01