Greybox and Firefox Back Button Issue

I started using Greybox for one of my web projects recently.  I like it because it’s a little different that plain old lightbox.

BUT, there was a problem.  In Firefox, after viewing a image and closing it, the back button would no longer work.  The workaround was found by Jani at http://amix.dk/blog/viewEntry/19039

Hello,
Regarding the issue with the back button in Firefox, i think i found a solution.
First i came with this suggestion:
http://efrtw.spaces.live.com/Blog/cns!68A490680B58FBDC!139.entry

I did tweak the script a bit more, and now it seems to work fine in firefox.
Here is the new script for version 5.53:

http://myfreefilehosting.com/f/aeaad9cb1c_0.01MB

The new gb_scripts.js file worked great!

8 comments

  1. Dziureq · August 21, 2008

    Can you explain a bit what further modifications did you make? I am asking because I use modified greybox (from Russ’ Dev Space blog) and ‘Back button’ works now but after watching gallery on page I need to hit ‘Back button ‘ as many times as many images I watched to go back to ‘page-before-page-with-gallery.
    Is there a chance that your modifications fixed this isse? :>
    Regards

  2. Dziureq · August 21, 2008

    And another thing: download link to Your version of GreyBox isn’t working.

  3. joelthecoder · August 21, 2008

    Dziureq,

    The broken link should be:

    http://myfreefilehosting.com/f/aeaad9cb1c_0.01MB

    Sorry about that!

    I didn’t do any of the modifications myself, I just used the one from this download. But doing a diff on the original and this one, I noticed that there were just some added checks to see which browser (IE or firefox) is being used. If it’s firefox, then the script just hides the iframe instead of removing it from the document.

    It addition to this, I did change the line

    this.overlay_click_close=false;

    to

    this.overlay_click_close=true;

    So that the image popup will disappear when the user clicks outside of the image. Otherwise, the user always has to click on the “X” to close it.

    I hope this helps, let me know if somethings unclear.

    -Joel

  4. User · August 26, 2008

    When I use that script, my IE7 still shows the image on top of the page even though the main popup window is closed.

  5. Jani · September 9, 2008

    Glad that the modified script helped you, and thanks for the addition.

  6. asdrubale · March 1, 2009

    the link doesn’t work. can anyone post it again?

  7. asdrubale · March 2, 2009

    Yes it works in an acceptable way.
    You can download it here:
    http://www.megaupload.com/?d=HL0E7W7R

  8. Pingback: Hack Greybox – Christoph Terno – Geschichte, Religion, Ethik

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s