Hey guys, I'm having a really small (but really big) problem in which lightbox will work when called in normal HTML like:
But will simply load the file in the browser window when calling it like:
I'm pretty sure there're no syntactical errors, as the page loads and maneuvers fine, but the "lightbox" part just doesn't work.
Edit: Solved my own question. Turns out you have to reinitialize lightbox after dynamically changing the HTML. Here's what works now:
Code:
<a href='sky.jpg' rel='lightbox'>Go</a>
But will simply load the file in the browser window when calling it like:
Code:
document.getElementById("right").innerHTML = "<a href=\'sky.jpg\' rel=\'lightbox\'>Go</a>"
I'm pretty sure there're no syntactical errors, as the page loads and maneuvers fine, but the "lightbox" part just doesn't work.
Edit: Solved my own question. Turns out you have to reinitialize lightbox after dynamically changing the HTML. Here's what works now:
Code:
document.getElementById("right").innerHTML = "<a href=\'sky.jpg\' rel=lightbox>Go</a>"
initLightbox();