When I hard code a link, the lightbox works just fine:
But, I need to create the links dynamically using javascript which I did with the following code:Code:<a href="http://www.harpandharptrading.com/images/tractors/6640ford.jpg" rel="lightbox[trac1]" title="my caption">image #1</a>
The link appears and when I look at it with firebug, it looks the same as the one I hard coded. But, when i click the link it takes me to a new page with just the image on it like it would if I typed in the url to the image.Code:var link = document.createElement("a"); link.href = "images/tractors/6640ford.jpg"; link.rel = "lightbox[trac1]"; link.title = "my caption"; link.innerHTML = "image1";
Can someone help please?
http://www.dynamicdrive.com/dynamici...box2/index.htm



Reply With Quote

Bookmarks