By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,364 Members | 1,343 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,364 IT Pros & Developers. It's quick & easy.

A little Lightbox Support

P: 7
Alright, I racked my brain all last night and can't figure out what I'm doing wrong. I've copied:

[html]
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
[/html]

in my header, as well as move the files into my js folder and placed at my root.

I also copied:

[html]
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
[/html]

and placed alongside my css in my html - above header, but also tried in header to see if it made a difference and it didn't. I as well, copied the css into the css folder and placed in root directory.

I then, placed at the image:

[html]
<a href="img/image-1.jpg" rel="lightbox" title="my caption">image #1</a>
[/html]

Now, I had the link with the source file as:

[html]
<a href="img/2008/nov/photos/Billy_Mays.jpg" rel="lightbox" title="Billy Mays"><img src="/img/2008/nov/photos/Billy_Mays.jpg" alt="Billy Mays" width="100" height="100" hspace="5" border="0"></a>
[/html]

also tried after to see if that would help and it didnt. So I'm thinking it's an interference, and while I do have a:

[html]
<body onLoad="goforit()>
[/html]

I linked them together with:

[html]
<body onLoad="goforit();initLightbox()">
[/html]

but still haven't gotten it to work - all it does is link to the actual image file on my root. I know this has to be a noobie question and I'm screwing up somewhere, I just can't figure it out. I spent all night trying variations that I thought could be making the difference.

Any help is always appreciated, you guys are awesome!
Nov 5 '08 #1
Share this Question
Share on Google+
8 Replies


acoder
Expert Mod 15k+
P: 16,027
What does goforit() do?
Nov 6 '08 #2

P: 7
I believe it runs my html form script. I have racked my brain again another night. Matching up scripts from sample sites and everything looks right. I copied the html and images and created the page and the lightbox works right, so it must only be a script interference.

I tried even taking out the body onload goforit () and just using the applied onload script and even just the <body> tags, but nothing worked. If you go onto www.thelampoonjournal.com is the page i'm trying to run it on with the photos at the bottom of the page. I took out the lightbox links because it just opens up in a new page - /img/2008/nov/XXX.jpg is the new page that opens up, but the rest of the links are still in there, so all I would need to do is adjust the linked pictures to match rel=lightbox.

If you could check out that coding if you get the chance and see maybe a conflict, I would greatly appreciate it. As you can probably see, the picture javascript picture viewer I am using currently isn't nearly as aesthetically nice.

Again, I really appreciate the help. I know you're helping with my legwork, I just can't find the interference! Thanks again.
Nov 6 '08 #3

acoder
Expert Mod 15k+
P: 16,027
I notice you're using jQuery and Lightbox is based on prototype and scriptaculous. Sure, you can get two libraries to mix and jQuery does allow you to do it, but I would suggest that you use only one library to save yourself the headache. Either look for a lightbox clone in jQuery or one that's not dependent on a library.
Nov 6 '08 #4

P: 7
ahh...is that what is causing the interference? The jquery is running a rich html text scroller. Is there a javascript code to utilize scriptaculous in a text scroller or should i just look for a lightbox in jquery? I didn't think that would be what would cause the intereference. Thanks!
Nov 6 '08 #5

acoder
Expert Mod 15k+
P: 16,027
Well, I'm not certain that that is the cause, but it could definitely be a possible cause - basically, one of the first things you'd look for.

Go with whichever library you're more comfortable with, or are you only using one because the script that you've included uses it?
Nov 6 '08 #6

P: 7
I don't really have a preference, I was merely going for the functionality of the script. Like Lightbox, the code for the rich text was a borrowed code that provided the desired results I was looking for.

I'll try that out tonight and report back if that works. Hopefully that is the answer. I have a number of tracking scripts on there but can't see how those would interfere. Is there anything in particular I should look for? Again, I'm kind of a newbie in the implementation of multiple functions.
Nov 6 '08 #7

P: 7
Wanted to let you know that removing the jquery script worked. Thank you for your help. It removed the scroller, but I'll look for something compatible with this script.
Nov 7 '08 #8

acoder
Expert Mod 15k+
P: 16,027
No problem. For a Prototype/scriptaculous scroller, just search for "prototype scroller". You'll probably find something you can use.
Nov 7 '08 #9

Post your reply

Sign in to post your reply or Sign up for a free account.