SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: javascript rollovers
-
Feb 2, 2004, 17:49 #1
- Join Date
- Feb 2004
- Location
- Montana
- Posts
- 2
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
javascript rollovers
Hi,
here is my problem: Im working on my moms website and had this crazy idea to have rollover images for buttons.
The thing is the "mouseover" images seem to just starting to load when you hover over the link which ruins the whole effect.I used different codes, even stuff that was recomended in this forum but nothing works. ok this is what gets me: I uploaded the same page to 2 other servers and my rollovers work just fine there...
why
please help!
here are the websites:
this works:
http://home.earthlink.net/~agata25/index2.html
this doesnt:
http://www.tlumaczenia.itl.pl
And the code:
<script language="Javascript" type="text/javascript">
<!--
if(document.images){
cen= new Image
cen1= new Image
cen.src="cennik.gif"
cen1.src="cennik1.gif"
}
else{
cen=" "
cen1=" "
document.cennik=" "
-->
</script>
<a href="cennik.html" onmouseover="document.cennik.src=cen1.src" onmouseout="document.cennik.src=cen.src">
<img src="cennik.gif" name="cennik" border="0"></a>
-
Feb 2, 2004, 19:09 #2
- Join Date
- May 2003
- Posts
- 1,843
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Aargh, Internet Explorer and its image-caching weirdnesses. As explained here, this problem is usually caused by specifying absolute urls instead of relative ones in your code. Not what you've done. Might be related to the fact that you've got a filename in the url that works, and a directory path in the one that doesn't - although adding 'index.html' doesn't help. Possibly a server configuration problem?
Hmm...just noticed some syntax errors.
Code:else{ cen=" " cen1=" " document.cennik=" " ---> This is wrong, and the image reference won't even exist until the relevant HTML is parsed (farther down the page) } //--> </script>
::: certified wild guess :::
-
Feb 9, 2004, 18:48 #3
- Join Date
- Feb 2004
- Location
- Montana
- Posts
- 2
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thank you soo much for the reply.I know that this is a common problem, I made sure to check out the forum archives before I posted the question.Anyway I'm glad to hear there might be something wrong with the server- I thought Im going nuts...
thanks again,
Agata
Bookmarks