Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Nov 2012
    Location
    Huddersfield, West Yorkshire
    Posts
    68
    Member #
    33961
    Liked
    5 times
    Using a cool JS/Jquery light box.
    Heres the thing:-

    Works fine in google Chrome, when you click an image in the gallery the image pops up fine.

    http://almondburyroofing.com

    if you check in Firefox and Opera, the image sticks to the top of the page.

    I tried to change to code in the javascript, see below. this works fine with Chrome but dosent seem to work in the aforementioned browsers.

    $window = $(window);
    top = $window.scrollTop() + $window.height() / 10;
    left = $window.scrollLeft();
    $lightbox = $('#lightbox');

  2.  

  3. #2
    Member
    Join Date
    Nov 2012
    Location
    Tampa. FL
    Posts
    59
    Member #
    33844
    Liked
    21 times
    At first glance, my guess is that it's because you have not declared your variables correctly and Chrome may be more forgiving that Firefox. Try adding var in front of the declaration for top and left:
    $window = $(window);
    var top = $window.scrollTop() + $window.height() / 100;
    var left = $window.scrollLeft();
    $lightbox = $('#lightbox'); $lightbox.css({
    top: top + '0 px', left: left + 'auto' }).fadeIn(this.options.fadeDuration);
    this.changeImage(imageNumber);
    I think that Firefox is making the css simply top (which it interprets as NULL) +0px which equals 0px.
    labforone/Ben likes this.
    Freelance Web Developer

  4. #3
    Member
    Join Date
    Nov 2012
    Location
    Huddersfield, West Yorkshire
    Posts
    68
    Member #
    33961
    Liked
    5 times
    Hi Ekim.

    Unfortunelty this has not changed anything. Damn Firefox/my code lol.

    Let me know if you have any other suggestions.

    It is all much appreciated.

  5. #4
    Member
    Join Date
    Nov 2012
    Location
    Tampa. FL
    Posts
    59
    Member #
    33844
    Liked
    21 times
    Try changiong line 184 of your lightbox.js file to
    top': top + 'px',

    It currently reads top': top + '0px', and I think it is just setting the top to 0px.
    I made a rough local copy of the site and this worked for me.
    labforone/Ben likes this.
    Freelance Web Developer

  6. #5
    Member
    Join Date
    Nov 2012
    Location
    Huddersfield, West Yorkshire
    Posts
    68
    Member #
    33961
    Liked
    5 times
    Ekim,

    You sir, are a ledgend!! Thankyou very much!



Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 01:47 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com