The X Close Window image does not display in IE7.

This is an awesome module, THANK YOU!!

Comments

colorado’s picture

I just noticed that the module produces the following path to that image when I look at the image properties in my browser - I assume this is the problem:

http://www.mysite.com/modules/greybox,modules/greybox/images/close.gif

By removing greybox,modules/ from the path the image displays correctly.

colorado’s picture

Line 17 of greybox.js parobably needs to be changed to render the image properly:

+ "Only local images are allowed.

");

colorado’s picture

Oops - here is that line 17 again:

+ "<img src='" + Drupal.settings.greybox.sitepath +"/images/close.gif' alt='Close window'/></div>");

AjK’s picture

Project: Janode » Greybox

For some reason filed under "Janode" and I believe should be "Greybox" ?

colorado’s picture

Yes my bad. Thanks for moving this.

Gurpartap Singh’s picture

Although there's no such case in any browser on linux and windows xp this side. But try changing that line to:

+ "<img src='" + Drupal.settings.greybox.sitepath[0] +"/images/close.gif' alt='Close window'

Maybe you have customized the drupal_add_js() part of greybox module? Or any thing in js file?

Gurpartap Singh’s picture

Sorry, here's complete line:

+ "<img src='" + Drupal.settings.greybox.sitepath[0] +"/images/close.gif' alt='Close window'/></div>");

colorado’s picture

YEP, that fixed it -- thank you very much Gurpartap. I guess that [0] after sitepath should be patched in to the distributed code, unless it messes up something else of course :-)

Gurpartap Singh’s picture

Status: Active » Fixed

Fix goes another way as it was meant to be. New version released.

colorado’s picture

Status: Fixed » Active

I just updated to version 5.x-1.1 and now the close image is broken again (at least in IE7). Here's what the path to the image shows in properties in my browser:

http://mysite.com/subdirectory/node/modules/greybox/images/close.gif

Whereas in order for it to work, it should read:

http://mysite.com/subdirectory/modules/greybox/images/close.gif

I tried adding that [0] again as above, but that did not work this time.

colorado’s picture

Version: 5.x-1.0 » 5.x-1.1

just changing version number to 5.x-1.1

Gurpartap Singh’s picture

Does changing:

drupal_add_js(array('greybox' => array('sitepath' => $path)), 'setting');

to:

drupal_add_js(array('greybox' => array('sitepath' => base_path() .$path)), 'setting');

solve the problem?

colorado’s picture

YES indeed it did! The image appears! Thank you again :-D

Gurpartap Singh’s picture

Status: Active » Reviewed & tested by the community
Grinin’s picture

I've got the latest version but the image still won't show up.... I'm getting this in the red X box.

http://bhnbc.chrisllorca.com/undefined/images/close.gif

$path is undefined?? That seems weird.

Any ideas?

Gurpartap Singh’s picture

Status: Reviewed & tested by the community » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)