PDA

View Full Version : Image Thumbnail Viewer Problem in Chrome



JustinBail23
06-01-2012, 05:20 AM
1) Script Title: Image Thumbnail Viewer

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/thumbnail.htm

3) Describe problem:
In Chrome, the top of the page shows the loading.GIF and the button to close the window when it's done being viewed. The code is in the top of the page, and has been for a while, and this is just starting to crop up now, so I don't know if it was a change to Chrome. It works fine in Firefox, and in IE it flashes the same stuff whilst loading the page, but disappears once the page is fully loaded. Once clicked on in Chrome, it stays hidden. The enlarged image also isn't centred when first clicked on, but I'm not too worried about that.

Is there an easy fix to this?

Thanks!

jscheuer1
06-01-2012, 10:28 AM
Works fine here in Chrome, at least on the demo page here on Dynamic Drive. Does that work OK for you in Chrome? If not, it could be settings in your Chrome browser.

But I suspect the demo page is fine in your Chrome.

I cannot be sure without seeing the page. But this seems like a problem caused by a missing or edited thumbnailviewer.css file.

If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.

JustinBail23
06-04-2012, 09:48 AM
Hello,
I checked the CSS, and it's identical to the one currently posted on the site, I really am at a loss here.

One of the pages we're using it on is this one:

http://www.slimlinewarehouse.com.au/clip-frame-DY05-S-A0.html

With messing with it, I got it to work if I move the script out out of the head tag and just into the html, but that doesn't explain why it's doing what it's doing.

Thanks in advance for your help

jscheuer1
06-04-2012, 04:44 PM
The page is in quirks mode. That gives browsers license to interpret HTML, javascript, and css in a very loose and idiosyncratic fashion with no regard to standards. So there's no way to predict with certainty what a given markup, script or style will do in any given browser. In addition there are other scripts on the page. One or more of these may be interfering. I found that the viewer worked OK-ish in my Chrome. The first time it loaded to the left. After that, if I dismissed it and opened it again it was centered. The loading and close images where in the upper left of the page at first.

I do see this in the source code:


<link href="http://www.slimlinewarehouse.com.au/CSS_01.css" rel="stylesheet" media="screen">
<script src="http://www.slimlinewarehouse.com.au/DHTML/imgThmbnail/thumbnailviewer.js" type="text/javascript">
/***********************************************
* Image Thumbnail Viewer Script- Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/</script>
<link rel="stylesheet" href="http://www.slimlinewarehouse.com.au/DHTML/imgThmbnail/thumbnailviewer.css" type="text/css">
</head>

That should be:


<link href="http://www.slimlinewarehouse.com.au/CSS_01.css" rel="stylesheet" media="screen">
<link rel="stylesheet" href="http://www.slimlinewarehouse.com.au/DHTML/imgThmbnail/thumbnailviewer.css" type="text/css">
<script src="http://www.slimlinewarehouse.com.au/DHTML/imgThmbnail/thumbnailviewer.js" type="text/javascript">
/***********************************************
* Image Thumbnail Viewer Script- Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
</head>

Notice that the stylesheet is now before the script and the closing script tag is below the script comment. I tried it here and it fixed it.

The browser cache may need to be cleared and/or the page refreshed to see changes.