Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Littleodie914

macrumors 68000
Original poster
Jun 9, 2004
1,813
8
Rochester, NY
Hey guys, I'm having a really small (but really big) problem in which lightbox will work when called in normal HTML like:

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. :confused:


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();
 

Littleodie914

macrumors 68000
Original poster
Jun 9, 2004
1,813
8
Rochester, NY
Looks great in Safari 3. Your app looks wicked too.
Thanks a lot :) I've got a few changes to make both with the site and the app, me and my friend are just starting some real-world testing, so I wouldn't tell all your friends about it just yet. :)

And yea, that's what's weird. In Safari, it works great. In Firefox, (I've got 2.0.0.4, the newest for Mac.) The screenshot windows in lightbox look atrocious. :confused:Any ideas?
 

Littleodie914

macrumors 68000
Original poster
Jun 9, 2004
1,813
8
Rochester, NY
Hmm, just switched over to Bootcamp, and the same problem occurs in Firefox for Windows. This seems to be my problem alone... Anyone seen this before? :confused:
 

Littleodie914

macrumors 68000
Original poster
Jun 9, 2004
1,813
8
Rochester, NY
Now, if you open the lightbox image on the index.html page (coded in HTML) THEN load the screenshots page and try any of the links that were dynamically changed, they all load just fine.

Why is it that opening that first image causes all the rest of them to work okay?
 

Littleodie914

macrumors 68000
Original poster
Jun 9, 2004
1,813
8
Rochester, NY
I still can't figure it out... I've been working on it most of the day. :(

Here's a screenshot I took so you can see exactly what the problem is:

Edit: Problem finally fixed! I snuck around on lightbox's site and downgraded from the latest 2.03.3 release to 2.02, and it fixed the problem entirely. Sorry for all the in-order posts. :)
 

Attachments

  • Picture 4.jpg
    Picture 4.jpg
    44.2 KB · Views: 101
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.