javascript - Performance of jQuery script which dynamically shows/removes images -


i'm thinking best way attach image button each row of list. want every row have button. after click, script should append div image (and run lightbox).

do think optimal way of doing is:

  1. onclick -> append , hide them
  2. run lightbox
  3. onexit -> .remove() images

i'm worried performance of that. slow browser or rather not?

fast written code:

function test(){   $.post(url, {id:'1'}, function(data){     $("#cache").append(data).children("a").first().trigger("click");     //returns sth <a href="" rel="lightbox"></a>   }); } 

and in lightbox.js @ function closing down script:

$("#cache").empty(); 


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -