473,387 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Have I done these rollovers correctly?

I've put together a rough copy of what will be my site's menu bar, but
I'm not sure if I've done the rollovers correctly (I got the code from
HTMLcodetutorial.com I think). Check the look and code out here -
http://www.sportsunion.strath.ac.uk/...est/index.html

When I roll my mouse over an image, it changes as expected, but in
Mozilla, when I take the mouse away, there is a slight delay before the
image reverts to its original state, which I haven't experienced
elsewhere (looks great in IE though, which 90% of my site's visitors
will be running, no doubt).

Thanks in advance for any input.
LC.

Jul 20 '05 #1
2 2044
Lorne Cameron wrote on 10 aug 2003 in comp.lang.javascript:
I've put together a rough copy of what will be my site's menu bar, but
I'm not sure if I've done the rollovers correctly (I got the code from
HTMLcodetutorial.com I think). Check the look and code out here -
http://www.sportsunion.strath.ac.uk/...est/index.html
your code:

<A HREF="" ONMOUSEOVER="image1.src='1_over.gif';"
ONMOUSEOUT="image1.src='1.gif';"><IMG NAME="image1" SRC="1.gif"
BORDER="0">

================
The over/out codes are better off in the img declaration
and then can be shorter using "this":

<A HREF="">
<IMG SRC="1.gif" BORDER="0"
ONMOUSEOVER="this.src='1_over.gif';"
ONMOUSEOUT="this.src='1.gif';"</A>
================
you could also use the preloaded var name:

<A HREF="">
<IMG SRC="1.gif" BORDER="0"
ONMOUSEOVER="this.src=image1.src;"
ONMOUSEOUT="this.src='1.gif';"</A>
================
or use functions:

<script>
function imgover(x){
x.save=x.src
x.src=x.id.substr(3)+"_over.gif"
}
function imgout(x){
x.src=x.save
}
</script>

<A HREF="">
<IMG SRC="1.gif" BORDER="0" id="gif1"
ONMOUSEOVER="imgover(this)"
ONMOUSEOUT="imgout(this)"</A>


not tested
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #2
Lorne Cameron wrote on 10 aug 2003 in comp.lang.javascript:
I've put together a rough copy of what will be my site's menu bar, but
I'm not sure if I've done the rollovers correctly (I got the code from
HTMLcodetutorial.com I think). Check the look and code out here -
http://www.sportsunion.strath.ac.uk/...est/index.html
your code:

<A HREF="" ONMOUSEOVER="image1.src='1_over.gif';"
ONMOUSEOUT="image1.src='1.gif';"><IMG NAME="image1" SRC="1.gif"
BORDER="0">

================
The over/out codes are better off in the img declaration
and then can be shorter using "this":

<A HREF="">
<IMG SRC="1.gif" BORDER="0"
ONMOUSEOVER="this.src='1_over.gif';"
ONMOUSEOUT="this.src='1.gif';"</A>
================
you could also use the preloaded var name:

<A HREF="">
<IMG SRC="1.gif" BORDER="0"
ONMOUSEOVER="this.src=image1.src;"
ONMOUSEOUT="this.src='1.gif';"</A>
================
or use functions:

<script>
function imgover(x){
x.save=x.src
x.src=x.id.substr(3)+"_over.gif"
}
function imgout(x){
x.src=x.save
}
</script>

<A HREF="">
<IMG SRC="1.gif" BORDER="0" id="gif1"
ONMOUSEOVER="imgover(this)"
ONMOUSEOUT="imgout(this)"</A>


not tested
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Susan Addams | last post by:
The website I'm working on is using a graphic image for the left navigation scheme. Say I've got a button called "home" and one called "home_rollover" where it's a lighter shade Is there a...
3
by: Norman Swartz | last post by:
Rollovers on a web page I created were instantaneous on my computer when the page was loaded directly from my hard drive, but were painfully slow when loaded from the web. However, on another...
3
by: John Ortt | last post by:
I appologise for reposting this but I have been trying to find a solution all week with no avail and I was hoping a repost might help somebody more knowledgable than myself to spot the message... ...
19
by: gallery | last post by:
I read somewhere that you can get Tim Murtaugh's Mo' Betta Rollovers to work in Firefox using just CSS (no javascript) . Can someone tell me how to do it? ...
14
by: webguru | last post by:
Okay, In the comps.language.javascript newsgroup, I was convinced to use CSS Rollovers instead of javascript. The first rollover went great. Although I can't get the text to align vertically in...
3
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - Why are my Rollovers so slow? ----------------------------------------------------------------------- Images...
5
by: Dinsdale | last post by:
Without using CSS styles or linked stylesheets, I need to apply formatting to text links that use rollover effects. I can NOT get the underline to show using this technique: <A...
1
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - Why are my rollovers so slow? ----------------------------------------------------------------------- Images...
1
by: luggi | last post by:
See code here: http://lsquareddesigns.com/som/collectivemedia/landing/test1.html At the bottom, as soon as i add rollovers, the margins are getting messed up but only in firefox. can someone...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.