/    Sign up×
Community /Pin to ProfileBookmark

JS doesn’t work for IE

Hi,
The following JQuery script works fine for Chrome and Firefox but doesn’t work for IE. Why is that?

here is the relevant source code:

[code=html]
<script src=”../AssafModules/Category Menu/jquery-1.3.1.min.js” type=”text/javascript”></script>
<script src=”../AssafModules/Category Menu/jquery.backgroundPosition.js” type=”text/javascript”></script>

<script type=”text/javascript”>
$(document).ready(function () {

$(‘#ver li a’).hover(
function () {
width = $(this).width() * (-1);
$(this).stop().animate({ ‘backgroundPosition’: ‘(‘ + width + ‘ 0)’ }, { duration: 200 });
},

function () {
$(this).stop().animate({ ‘backgroundPosition’: ‘(0 0)’ }, { duration: 200 });

}
);

$(‘#hor li a’).hover(
function () {
height = $(this).height() * (-1);
$(this).stop().animate({ ‘backgroundPosition’: ‘(0 ‘ + height + ‘)’ }, { duration: 200 });
},

function () {
$(this).stop().animate({ ‘backgroundPosition’: ‘(0 0)’ }, { duration: 200 });
}
);

});

</script>

<div class=”navigate-bottom-border”></div>

<script type=”text/javascript”>

$(document).ready(function () {

$(‘#ver li a’).hover(
function () {
width = $(this).width() * (-1);
$(this).stop().animate({ ‘backgroundPosition’: ‘(‘ + width + ‘ 0)’ }, { duration: 200 });
},

function () {
$(this).stop().animate({ ‘backgroundPosition’: ‘(0 0)’ }, { duration: 200 });
}
);

$(‘#hor li a’).hover(
function () {
height = $(this).height() * (-1);
$(this).stop().animate({ ‘backgroundPosition’: ‘(0 ‘ + height + ‘)’ }, { duration: 200 });

},

function () {
$(this).stop().animate({ ‘backgroundPosition’: ‘(0 0)’ }, { duration: 200 });
}
);
});

</script>

<div style=”padding-right:10px;padding-top:10px;”>

<ul id=”ver”>

<li><a href=”http://stereoshackn.co.il/category/56-.aspx” class=”receivers”></a></li>
<li><a href=”http://stereoshackn.co.il/category/56-.aspx” class=”speakers”></a></li>
<li><a href=”http://stereoshackn.co.il/category/56-.aspx” class=”homeCinema”></a></li>

</ul>

</div>
[/code]

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @asiasi 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.19,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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