PDA

View Full Version : Cross Browser Issues using jQuery Image Magnify with Text and Image Crawler



RelearningHTML
11-15-2011, 08:53 PM
I am using both the Text and Image Crawler (http://www.dynamicdrive.com/dynamicindex2/crawler/index.htm) and the jQuery Image Magnify (http://www.dynamicdrive.com/dynamicindex4/imagemagnify.htm) scripts on my home page at http://www.bvgasa.org/. They both work great.

I now am trying to use both on the Image Crawler marquee in the header, to enable magnifying any of the pics on the crawler. I added class=”magnify” to the <img> tag for the photos in the crawler and it works when using IE9 and Chrome. For IE7 & IE8 I get the magnifying glass but the alt attribute comes up and the pic does not blow up. Not sure how this responds with other Browsers.

So it seems I have compatibility issues here. Any suggestions on script modifications I can use to overcome this?

I also use some other scripts of yours. They have really enhanced my web site. The viewer feedback has been terrific and it’s thanks mostly to your work. Thanks very much.

jscheuer1
11-16-2011, 06:19 PM
The problem arises because Crawler duplicates the image train in order to be continuous. So sometimes it's not ready (half of it) even in those browsers where it is working, like if the images aren't already cached. In IE less than 8, since the crawler is in a table, due to limitations of those browsers, crawler must wait until the window onload event to initialize. This is too late for Image magnify to do its work.

I tried this out in a local mock up of the page and it worked -

First, update to jQuery version 1.6.4 by changing this:


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

to:


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>

Use this unofficial update of the jquery.magnifier.js script:

4214

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

RelearningHTML
11-17-2011, 05:58 AM
Thanks very much for your time and efforts John. That took care of it.