Nextgen Gallery Image Display Errors in Internet Explorer

November 19, 2008 by Shane Hartman  
Filed under wordpress

When I made my first NextGen Gallery in Wordpress and clicked one of the thumbnails in IE7, the Gallery displayed the image at the bottom of the browser. About one third of the image and the menu options (close, next, prev) were obscured. VERY ANNOYING.

Rather than debug the default thickkbox presentation code immediately, I installed a different presentation plugin and declared victory.

But Nextgen still uses the thickbox presentation method when view is clicked in the gallery administrative interface. ARRGGGH! Alright, we will debug the damn thing...

I pretty quickly determine the problem to be in this code:

Line 310, thickbox/thickbox.js

Note that this version of thickbox is not the same as the distribution thickbox, it has been modified for the nextgen gallery and is included as a subdirectory of the plugin. The problem, however, is not the fault of the plugin but jQuery which it uses. The jQuery.browser.version statement is returning 6.0 in my browser, even though the version is 7.0.6 which causes the code to execute some IE6 only css hacks. Apparently Microsoft changed something which broke jQuery. You can read about that jamazon.co.uk, which I found when googling for a solution to the problem.

The solution is to modify the thickbox/thickbox.js file included with nextgen as follows (add these lines to the top of the file after the comment header):

$.browser.msie6

Then change:

Line 310, thickbox/thickbox.js

Also note that nextgen doesn't actually load thickbox/thickbox.js. For efficiency, it loads thickbox/thickbox-pack.js. which is thickbox.js with all whitespace removed. So you can run a javascript packing filter like jsmin to produce the packed file or just save the patched thickbox.js to thickbox-pack.js for small loss of efficiency.

You can download my patched files here thickbox-patch.zip.

Share with others:
  • email
  • Facebook
  • MySpace
  • Print
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis
  • Yahoo! Buzz
  • Digg
  • del.icio.us
Login or register to rate this article: 0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)

Comments

3 Responses to “Nextgen Gallery Image Display Errors in Internet Explorer”
  1. Vincent says:

    This worked for me! all versions of ie were displaying 2 pictures for each gallery item when clicked. I placed the first chunk of code right after the file comments, and although line 310 is no longer in the thickbox.js as written here, i just placed the second chunk of code at the end of the file. now it seems to be working perfectly in all browsers.

    Thanks for the help!

Trackbacks

Check out what others are saying about this post...
  1. [...] Nextgen Gallery Image Display Errors in Internet Explorer | On The Net [...]

  2. [...] ist, meine Bilder im Großformat anzusehen. Aufgrund dessen habe ich ein bisschen gegooglet und diesen BugFix gefunden. Ab sofort sollte die Anzeige der Bilder also auch im Internet Explorer ohne Probleme [...]



Tell us what you're thinking...
and if you want a pic to show with your comment, go get a gravatar!