Submit Your Article Forum Rules

Results 1 to 4 of 4

Thread: Lightbox is messing up my slideshow on my webpage?

  1. #1
    Member
    Join Date
    Jul 2011
    Posts
    36

    Lightbox is messing up my slideshow on my webpage?

    Hello. I am working on one of my websites. I have a slideshow on there that looks decent.

    Today I added "Lightbox" to the top of my right sidebar for YouTube videos. It looks really nice. When I added in the script to the header of all my pages, the slideshow on my home page stopped working.
    www.pokemonsocial.com

    Any ideas?

    thanks,
    Kyle

  2. #2
    Moderator HTMLBasicTutor's Avatar
    Join Date
    Apr 2010
    Location
    Canada
    Posts
    934
    You have some script errors:
    Webpage error details

    Timestamp: Sat, 21 Jan 2012 23:12:27 UTC


    Message: Invalid character
    Line: 98
    Char: 4
    Code: 0
    URI: http://www.pokemonsocial.com/


    Message: 'jQuery.timeago.settings' is null or not an object
    Line: 113
    Char: 1
    Code: 0
    URI: http://www.pokemonsocial.com/


    Message: Object doesn't support this property or method
    Line: 166
    Char: 4
    Code: 0
    URI: http://www.pokemonsocial.com/
    Accrete Web Solutions - Search engine friendly websites, ecommerce websites & blogs
    Web Page Mistakes - Web page mistakes with solutions
    HTML Basic Tutor - HTML help to learn HTML basics

  3. #3
    WebProWorld MVP morestar's Avatar
    Join Date
    Jun 2007
    Location
    Toronto, Ontario (Burlington)
    Posts
    4,249
    I can't find the slide show but I did click on the "Battle of the Week" image and the video did pop up but without a faded background AND I couldn't click to close anywhere on the screen to close the lightbox (I think it's the lightbox we're all used to).

    I checked your code, and found rel="#voverlay"

    That's fine but I would scrap your entire lightbox code and try using shadowbox. It's great. All you need to do is:


    1. download the package after choosing all the options (just in case you need them one day)
    2. upload the unzipped folder to your public folder on your server
    3. add rel="shadowbox" to your links
    4. add the following code below, above the </head> tag
    5. and add widths and heights to the opened window as you wish thus: rel="shadowbox;height=140;width=120">

    Code:
    <link rel="stylesheet" type="text/css" href="/shadowbox-3.0.3/shadowbox.css">
    <script type="text/javascript" src="/shadowbox-3.0.3/shadowbox.js"></script>
    <script type="text/javascript">
    Shadowbox.init();
    </script>
    Note in the paths to the scripts in the above code that I added "shadowbox-3.0.3" because that's the name of the folder the files come in and so that would be the path to them after uploading them.

    Here are a few more shadowbox options you can experiment with.

    Hope this helps!
    Join a free dating site and meet single people in your area.
    Submit your content at my content publishing site and promote your business, services or opinions.

  4. #4
    Administrator weegillis's Avatar
    Join Date
    Oct 2003
    Posts
    5,788
    While I don't go along with tossing the baby with the bath water, which is basically what the above suggests, I do go along with the suggested alternative, if for only one reason: Where the OP's lightbox may be encountering some clashes, this one likely won't, as, in their own words, "Free from Frameworks."


    The script tags don't need to be in the <head>. They can be just before the </body> endtag, and be just as effective. This would almost be the recommendation if images are acquired dynamically with AJAX. One will want everything in place in the DOM before firing this script, else some things could get missed. If leaving the script in the head AND dynamically acquiring images with AJAX, then add a ' defer="defer" ' attribute to the script tag so it is forced to fire last.

    When creating a slideshow sequence, or 'gallery', you will need to configure the rel attributes with a gallery identifier, as in,
    HTML Code:
    rel="shadowbox[mygallery]"
    Catching up...
    If one places at least the INIT method at the bottom of the body element, then in principle this script will be the last to fire, so a defer attribute would not be needed on the SRC script tag.

    OT: Many would argue that all script tags ought be at the end of the body element, so the HTML, CSS and page elements get first crack at filing in. Personally, I go along with this. Some scripts have to be at the start, no two ways about it. Most, however, are content to be fired after the document is ready, which is how it should be.
    Last edited by weegillis; 03-14-2012 at 07:09 PM. Reason: addendum

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •