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:
- onclick -> append , hide them
- run lightbox
- 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
Post a Comment