/    Sign up×
Community /Pin to ProfileBookmark

Having problems with assigning onmouseover and onmouseout using an external script

Hi everyone,

I know this is 100% out of context, but does anyone see anything wrong with the following?

[code]
lots of crap
.
.
.
</div>
<!–[if lte IE 6]>
<script type=”text/javascript”>
initialize();
</script>
<![endif]–>
</body>
</html>
[/code]

[code]
function initialize()
{
document.getElementsByTagName(“span”)[0].style.filter = “progid:DXImageTransform.Microsoft.AlphaImageLoader(src=’/images/gallery/prevImg.png’, sizingMethod=’crop’)”;
document.getElementsByTagName(“span”)[1].style.filter = “progid:DXImageTransform.Microsoft.AlphaImageLoader(src=’/images/gallery/downImg.png’, sizingMethod=’crop’)”;
document.getElementsByTagName(“span”)[2].style.filter = “progid:DXImageTransform.Microsoft.AlphaImageLoader(src=’/images/gallery/nextImg.png’, sizingMethod=’crop’)”;
document.getElementsByTagName(“li”)[5].onmouseover = overOut();
document.getElementsByTagName(“li”)[5].onmouseout = overOut();
}
[/code]

Thanks,
Douglas

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@FangFeb 16.2007 — document.getElementsByTagName("li")[5].onmouseover = function() {overOut();};
Copy linkTweet thisAlerts:
@DJRobThaManauthorFeb 16.2007 — Thanks Fang, but it still doesn't work. Actually, it doesn't work though. Interestingly enough, if i type document.getElementsByTagName("li")[5].onmouseover = alert("hi"); the alert goes off once the page is loaded. Do you know why this would happen?

Douglas
×

Success!

Help @DJRobThaMan 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.20,
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,
)...