/    Sign up×
Community /Pin to ProfileBookmark

change background image position on mouseover

i have this working in all target browsers…except IE

so, i have a table…

[code]<div id=”gameslist”>
<table>
<tr>
<td>home team</td>
<td>home score</td>
<td>away score</td>
<td>away team</td>
</tr>
<tr>…
</table>
</div>[/code]

…and a function…

[code]function setmouseover() {
var rows=document.getElementById(‘gamelist’).getElementsByTagName(‘TR’);
for(var i=0; i<rows.length; i++) {
if(rows[i].className==’off’) {
rows[i].onmouseover=function() {this.style.backgroundPosition=’-300px 0′}
rows[i].onmouseout=function() {this.style.backgroundPosition=’0 0′}
}
}
}[/code]

in my stylesheets i’ve already set a background image for the <tr> tags and this is supposed to just move the image position for a rollover effect. It’s working everywhere but microsoft’s wonderful browser of course. Any hints on making this IE friendly without breaking it for other browsers?

thanks!

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @bcamp1973 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.27,
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,
)...