How to set attribute when loaded ?
Hi, i'm trying jquery, and i want do do something .. that seems i cant understand how to do.
thats my problem :
i've got a page with some link and a div, every link calls this function :
- function ajax_page(ele,url){
-
- $(ele).load(url);
- setTimeout('justify()', 300);
- }
the justify function its made by me and resize the div with the right dimensions.
now i wanted to load some pages with inside some images that i want to be loaded with fancybox
so i've putted this code into the $(function(){ init
- $(function(){
- $("a#fancybox").fancybox({
- });
- }
if i simply add an image with
- <a href='image.jpg' id='fancybox'><img src='thumb.jpg'></a>
works like a charm, but if i make jquery load the same code (<a href='image.jpg' id='fancybox'><img src='thumb.jpg'></a>) from an external html file, than this image wont work with fancybox.
i think that is because this div with the image is not loaded from the beginning and so jquery cant recognise him.
how could make it works ? , i think that i would need something that will initialize the new boxes when i load em into the div ...