/    Sign up×
Community /Pin to ProfileBookmark

My script won’t work in Internet Explorer. Help?

I wrote a script (with help from jQuery) to show an image preview of a product when you mouse over the magnifying glass. The problem is, it doesn’t work in Internet Explorer, but it works with every other browser. Here’s the link: [url]http://tiny.cc/fa0jy[/url]

I have it turned off for IE right now, but when it’s on, the div that is supposed to become unhidden and in a relative position with the second highest z-index, is, well, not. It just appears inline with the rest of the elements and pushes everything else out of the way when it appears after hovering over the magnifying glass.

I figure it might be because the host places some styling before the doctype is declared, but I can’t do anything about that, I don’t think. I’ve tried removing it with a script, but it didn’t work. Do you think this is the problem?

Here’s my script (with css too), btw. I’ve had to do a few workarounds, since I can’t directly edit the html of the items on the page.

(the jquery library is sourced in the head, btw)

[CODE]
<style type=”text/css”>
.hidden {display:none; z-index:2;}
.visible {background-image:url(‘http://www.gogglesandglasses.com/f/popupborder.png’); z-index:2; position:fixed; left:25&#37;; top:10%; height:515px; width:683px;}
.visible img {height:480px; width:640px; margin-top:10px; border-width:0px;}
.hide:hover{z-index:3; opacity:0;}
</style>

<script type=”text/javascript”>
pic1= new Image(100,25);
pic1.src=”http://www.gogglesandglasses.com/i/Buttons/loading.gif”;
pic2= new Image(100,25);
pic2.src=”http://www.gogglesandglasses.com/f/popupborder.png”;
var browser=navigator.appName;
var aaa;
var ccc;
var bbb;

if (browser!=”Microsoft Internet Explorer”)
{
$(document).ready(function(){
$(“p img”).after(“<img src=”/f/Magnifying-Glass-icon.png” class=”hide” onmouseover=”aaa=this.parentNode.childNodes[1].src;ccc=aaa.split(‘http://www.gogglesandglasses.com/t’)[1];bbb=’http://www.gogglesandglasses.com/i’;this.parentNode.childNodes[3].className=’visible’;this.parentNode.childNodes[3].firstChild.src=bbb+ccc;” onmouseout=”this.parentNode.childNodes[3].className=’hidden’;” style=”position:relative; top:-90; height:16px; width:16px; border:0px;”></img><div class=”hidden”><img src=”http://www.gogglesandglasses.com/i/Buttons/loading.gif”/></div>”);

})

}

</script>[/CODE]

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@WolfShadeDec 28.2009 — Did you check to see what error messages IE is giving? See attachment. Hopefully, this will help you troubleshoot. If not, I can take a closer look, later, and get back to you.

^_^

[upl-file uuid=d050442d-3e8e-48c5-bfc3-533c9fa972af size=21kB]js_error_msg.gif[/upl-file]
Copy linkTweet thisAlerts:
@RheukalaauthorDec 29.2009 — ? I don't see an error message.

I've turned it on for IE so you can see what it's doing.
Copy linkTweet thisAlerts:
@WolfShadeDec 29.2009 — Did you look at the file I attached to my reply? Those are the two error messages that IE is giving when I moused over the magnifying glass.

^_^
Copy linkTweet thisAlerts:
@RheukalaauthorDec 29.2009 — Yeah, I saw, but there's nothing on line 341, and the doc doesn't even have 3975 lines, so I'm confused.
Copy linkTweet thisAlerts:
@RheukalaauthorDec 30.2009 — Nobody sure how to solve this?
×

Success!

Help @Rheukala spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...