A little Lightbox Support

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vanald04
    New Member
    • Nov 2008
    • 7

    A little Lightbox Support

    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.j s?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!
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    What does goforit() do?

    Comment

    • vanald04
      New Member
      • Nov 2008
      • 7

      #3
      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.

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        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.

        Comment

        • vanald04
          New Member
          • Nov 2008
          • 7

          #5
          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!

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            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?

            Comment

            • vanald04
              New Member
              • Nov 2008
              • 7

              #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.

              Comment

              • vanald04
                New Member
                • Nov 2008
                • 7

                #8
                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.

                Comment

                • acoder
                  Recognized Expert MVP
                  • Nov 2006
                  • 16032

                  #9
                  No problem. For a Prototype/scriptaculous scroller, just search for "prototype scroller". You'll probably find something you can use.

                  Comment

                  Working...