/    Sign up×
Community /Pin to ProfileBookmark

My Dynamic css isn’t working

I want to my background behind the link to flip.

Here’s my script in the HEAD part of the document:

<SCRIPT language=”text/JavaScript”>
<!–

function changeCell(id)
{
document.getElementById(id).style.background-image = “url(mouseOver.gif);
}

function changeCellBack(id)
{
document.getElementById(id).style.background-image = “url(mouseOff.gif);
}

// –>

</SCRIPT>

Then I have my link:

<TD background=”mouseOff.gif” class=”cell1″ width=”100″>
<A HREF=”#” onMouseOver=”changeCell(cell1)” onMouseOut=”changeCellBack(cell1)”>link link link</A>
</TD>

I used arguments so that I wouldn’t have to have 2 functions for each link. It doesn’t work?!?

I have no idea why.

Help would be very greatly appreciated

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Aug 01.2005 — with JavaScript:

background-image

should be

backgroundImage
Copy linkTweet thisAlerts:
@crazycoderauthorAug 01.2005 — it still doesn't work.
Copy linkTweet thisAlerts:
@Jonny_LangAug 01.2005 — ......
Copy linkTweet thisAlerts:
@crazycoderauthorAug 01.2005 — I have IE 5.0. If that makes a difference.
Copy linkTweet thisAlerts:
@Jonny_LangAug 01.2005 — Did you try the previous post?
Copy linkTweet thisAlerts:
@crazycoderauthorAug 01.2005 — yes, I did, I still can't get it to work. I am thinking about just using image flips.
Copy linkTweet thisAlerts:
@Jonny_LangAug 01.2005 — You didn't try the code I posted AS IS, did you? No problem.... won't beg you...

I'll just delete it.
Copy linkTweet thisAlerts:
@crazycoderauthorAug 01.2005 — It works!!!!!!!!!

Thanks a million!
×

Success!

Help @crazycoder 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.28,
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,
)...