SitePoint Sponsor |
|
User Tag List
Results 1 to 11 of 11
-
Feb 1, 2001, 04:31 #1
- Join Date
- Feb 2001
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Dear All,
I'm new to SitePoint and I hope someone can help or advise me. Below is the javascript I have on each of the pages for the links on my website: http://homepage.eircom.net/~hogsruscork
Everything works in IE5, but I have problems in Netscape 4.6, and Netscape 6.
In NS4.6, the rollover works once, without the sound, and then just flips from the "off" state to the last frame of the "on" state in the animated gif.
In NS6 however, still no sound, and the rollover just goes from the initial "off" state to a blank "on" state.
I would really appreciate it if anyone could offer some advice as to where my problem might lie.
Thanks in advance.
Keith Kenrick.
<html>
<head>
<title></title>
<script language="JavaScript">
<!--
if (document.images){
bikeOn = new Image
bikeOff = new Image
bikeOn.src = "images/bikeon.gif"
bikeOff.src = "images/bikeoff.gif"
bikeOn1 = new Image
bikeOff1 = new Image
bikeOn1.src = "images/bikeon.gif"
bikeOff1.src = "images/bikeoff.gif"
bikeOn2= new Image
bikeOff2 = new Image
bikeOn2.src = "images/bikeon.gif"
bikeOff2.src = "images/bikeoff.gif"
bikeOn3 = new Image
bikeOff3 = new Image
bikeOn3.src = "images/bikeon.gif"
bikeOff3.src = "images/bikeoff.gif"
}
else
{
bikeOn = ""
bikeOff = ""
bikeOn1 = ""
bikeOff1 = ""
bikeOn2 = ""
bikeOff2 = ""
bikeOn3 = ""
bikeOff3 = ""
}
//-->
</script>
</head>
<body>
<!--THESE ARE THE LINKS-->
<p><strong><a href="bikes.html" onMouseover="document.bike.src=bikeOn.src, playHome()" onMouseout="document.bike.src=bikeOff.src">
<img src="images/bikeoff.gif" align="middle" border="0" name="bike"><br>Bikes</a></strong>
<p><strong><a href="parts_accs.html" onMouseover="document.bike1.src=bikeOn1.src, playHome()" onMouseout="document.bike1.src=bikeOff1.src">
<img src="images/bikeoff.gif" align="middle" border="0" name="bike1"><br>Parts & Accessories</a></strong>
<p><strong><a href="contact.html" onMouseover="document.bike2.src=bikeOn2.src, playHome()" onMouseout="document.bike2.src=bikeOff2.src">
<img src="images/bikeoff.gif" align="middle" border="0" name="bike2"><br>Contact/Mail Order</a></strong>
<p><strong><a href="links.html" onMouseover="document.bike3.src=bikeOn3.src, playHome()" onMouseout="document.bike3.src=bikeOff3.src">
<img src="images/bikeoff.gif" align="middle" border="0" name="bike3"><br>Links</a></strong>
<!-- THIS CODE AT THE END OF THE PAGE . IT ENABLES THE SOUND-->
<embed src="varoom.wav" autostart="false" hidden="true">
<script language="JavaScript">
<!--
function playHome()
{
if (document.all)
{
document.all.sound.src = "varoom.wav";
}
}
//-->
</script>
<bgsound id="sound">
</body>
</html>
-
Feb 1, 2001, 16:47 #2
- Join Date
- Jul 1999
- Location
- SC, USA
- Posts
- 390
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hey hirogen,
Your first and real problem is that you use a "," to seperate functions in an event. Instead, you need to use a semicolor (
So, try:
onMouseover="document.bike.src=bikeOn.src; playHome()"
and do the same sort of thing for the first one. As for your sound, that script you have is designed to only work in IE 4+. instead, you might want to look into another script that should work in most newer browsers. You can check it out here:
http://www.wsabstract.com/script/scr...oundlink.shtml
Just remember to use the semicolon between different function/statement calls.
Good Luck,
aDogModerator at www.javascriptcity.com/forums/
-
Feb 2, 2001, 04:16 #3
- Join Date
- Feb 2001
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hey Arielladog,
Many thanks for your reply, will try it out and see how I get on. By the way, cool name, where did you get it?
Keith.
-
Feb 2, 2001, 15:12 #4
- Join Date
- Jul 1999
- Location
- SC, USA
- Posts
- 390
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hey Keith,
Actually, because of my name, I've been confused with a girl, but I'm 100% male. It's just my dog's name is "Ariel" hence Arielladog
Good Luck,
aDogModerator at www.javascriptcity.com/forums/
-
Feb 6, 2001, 09:09 #5
- Join Date
- Feb 2001
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hey Adog,
Have tried this script you pointed me too about 5 million times at this stage. No show. Could there be some reason as to why it wouldn't work?? See thing is, I tried out the site you pointed me too with Netscape 4.6 and the sounds are NOT rendering. The browser throws up Javascript errors....
Please help!
Thanks,
Keith.
-
Feb 6, 2001, 17:14 #6
- Join Date
- Jul 1999
- Location
- SC, USA
- Posts
- 390
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Please post a URL or some code.
aDogModerator at www.javascriptcity.com/forums/
-
Feb 7, 2001, 05:06 #7
- Join Date
- Feb 2001
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi AriellaDog,
Thanks for replying. The URL to my site is this:
http://homepage.eircom.net/~hogsruscork
Thnig is, what you'll see when you view the source code is the code in my first post. I have been working on offline copies of the code you sent me. Here's pretty much what I've managed to come up with. I've probably omitted something incredibly obvious....
<html>
<head>
<title>ROLLOVER</title>
<script language="JavaScript">
<!--
if (document.images){
bikeOn = new Image
bikeOff = new Image
bikeOn.src = "bikeon.gif"
bikeOff.src = "bikeoff.gif"
}
else
{
bikeOn = ""
bikeOff = ""
}
//-->
</script>
<script LANGUAGE="JavaScript"><!--
var aySound = new Array();
// Below: source for sound files to be preloaded
aySound[0] = "varoom.wav";
// DO NOT edit below this line
document.write('<BGSOUND ID="auIEContainer">')
IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
ver4 = IE||NS? 1:0;
onload=auPreload;
function auPreload() {
if (!ver4) return;
if (NS) auEmb = new Layer(0,window);
else {
Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
document.body.insertAdjacentHTML("BeforeEnd",Str);
}
var Str = '';
for (i=0;i<aySound.length;i++)
Str += "<EMBED SRC='"+aySound[i]+"' AUTOSTART='FALSE' HIDDEN='TRUE'>"
if (IE) auEmb.innerHTML = Str;
else {
auEmb.document.open();
auEmb.document.write(Str);
auEmb.document.close();
}
auCon = IE? document.all.auIEContainer:auEmb;
auCon.control = auCtrl;
}
function auCtrl(whSound,play) {
if (IE) this.src = play? aySound[whSound]:'';
else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"))
}
function playSound(whSound) { if (window.auCon) auCon.control(whSound,true); }
function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); }
//-->
</script>
</head>
<body>
<a href="bikes.html" onMouseover="document.bike.src=bikeOn.src; playSound(0)" onMouseout="document.bike.src=bikeOff.src; stopSound(0)">
<img src="bikeoff.gif" align="middle" border="0" name="bike"><br>Bikes</a>
</body>
</html>
-
Feb 7, 2001, 15:15 #8
- Join Date
- Jul 1999
- Location
- SC, USA
- Posts
- 390
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hey, it seemed to work for me in IE and NN.
aDogModerator at www.javascriptcity.com/forums/
-
Feb 7, 2001, 16:07 #9
- Join Date
- Jan 2001
- Location
- Ireland
- Posts
- 9
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Doesn't work for me either (using NS 6 on Win 98) rollovers are fine tho'
-
Feb 8, 2001, 03:54 #10
- Join Date
- Feb 2001
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hey AriellaDog, Tharg,
Did exactly what I posted work for you AriellaDog? what version of NS are you using?? I've tried 4.6 and 6 and the code doesn't work right! Could this be a plugins issue??
Tharg: Thanks for trying out the code also. Glad someone else couldn't get it to work
Any last suggestions...anyone...??
Thanks in advance. In the meantime if I come up with a solution, I'll be sure to let you know.
Keith.
-
Feb 8, 2001, 04:46 #11
- Join Date
- Feb 2001
- Posts
- 7
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Type about
lugins into your address bar in NS - it'll tell you what plugins you have. I seem to be missing some audio ones (Liquid Audio...hmmm) I'll get back to you on this one hirogen7.
Bookmarks