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.jsNote 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.msie6Then change:
Line 310, thickbox/thickbox.jsAlso 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.



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!