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

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -