Forum Moderators: open
Slide Show:
<script type="text/javascript">
var sliderwidth="800px"
var sliderheight="146px"
//Specify the slider's slide speed (larger is faster 1-10)
var slidespeed=2
//configure background color:
slidebgcolor="#31387B"
//Specify the slider's images
var leftrightslide=new Array()
var finalslide=''
leftrightslide[0]='<img src="1.jpg" border=0>'
leftrightslide[1]='<img src="2.jpg" border=0>'
leftrightslide[2]='<img src="3.jpg" border=0>'
leftrightslide[3]='<img src="4.jpg" border=0>'
leftrightslide[4]='<img src="5.jpg" border=0>'
leftrightslide[5]='<img src="6.jpg" border=0>'
leftrightslide[6]='<img src="7.jpg" border=0>'
leftrightslide[7]='<img src="8.jpg" border=0>'
leftrightslide[8]='<img src="9.jpg" border=0>'
//Specify gap between each image (use HTML):
var imagegap=""
//Specify pixels gap between each slideshow rotation (use integer):
var slideshowgap=0
////NO NEED TO EDIT BELOW THIS LINE////////////
var copyspeed=slidespeed
leftrightslide='<nobr>'+leftrightslide.join(imagegap)+'</nobr>'
var iedom=document.all¦¦document.getElementById
if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+leftrightslide+'</span>')
var actualwidth=''
var cross_slide, ns_slide
function fillup(){
if (iedom){
cross_slide=document.getElementById? document.getElementById("test2") : document.all.test2
cross_slide2=document.getElementById? document.getElementById("test3") : document.all.test3
cross_slide.innerHTML=cross_slide2.innerHTML=leftrightslide
actualwidth=document.all? cross_slide.offsetWidth : document.getElementById("temp").offsetWidth
cross_slide2.style.left=actualwidth+slideshowgap+"px"
}
else if (document.layers){
ns_slide=document.ns_slidemenu.document.ns_slidemenu2
ns_slide2=document.ns_slidemenu.document.ns_slidemenu3
ns_slide.document.write(leftrightslide)
ns_slide.document.close()
actualwidth=ns_slide.document.width
ns_slide2.left=actualwidth+slideshowgap
ns_slide2.document.write(leftrightslide)
ns_slide2.document.close()
}
lefttime=setInterval("slideleft()",30)
}
window.onload=fillup
function slideleft(){
if (iedom){
if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+8))
cross_slide.style.left=parseInt(cross_slide.style.left)-copyspeed+"px"
else
cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth+slideshowgap+"px"
if (parseInt(cross_slide2.style.left)>(actualwidth*(-1)+8))
cross_slide2.style.left=parseInt(cross_slide2.style.left)-copyspeed+"px"
else
cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+slideshowgap+"px"
}
else if (document.layers){
if (ns_slide.left>(actualwidth*(-1)+8))
ns_slide.left-=copyspeed
else
ns_slide.left=ns_slide2.left+actualwidth+slideshowgap
if (ns_slide2.left>(actualwidth*(-1)+8))
ns_slide2.left-=copyspeed
else
ns_slide2.left=ns_slide.left+actualwidth+slideshowgap
}
}
if (iedom¦¦document.layers){
with (document){
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
if (iedom){
write('<div style="position:relative;width:'+sliderwidth+';height:'+sliderheight+';overflow:hidden">')
write('<div style="position:absolute;width:'+sliderwidth+';height:'+sliderheight+';background-color:'+slidebgcolor+'" onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed">')
write('<div id="test2" style="position:absolute;left:0px;top:0px"></div>')
write('<div id="test3" style="position:absolute;left:-1000px;top:0px"></div>')
write('</div></div>')
}
else if (document.layers){
write('<ilayer width='+sliderwidth+' height='+sliderheight+' name="ns_slidemenu" bgColor='+slidebgcolor+'>')
write('<layer name="ns_slidemenu2" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>')
write('<layer name="ns_slidemenu3" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>')
write('</ilayer>')
}
document.write('</td></table>')
}
}
</script>
Menu:
<SCRIPT type=text/javascript>
function Go(){return}
</SCRIPT>
<SCRIPT src="http://www.mysite.com/exmplmenu_var.js" type=text/javascript></SCRIPT>
<SCRIPT src="http://www.mysite.com/menu_com.js" type=text/javascript></SCRIPT>
<noscript>Your browser does not support script</noscript>
Doing a quick copy and past of the script you have given, I found that I needed to replace the pipe symbols (¦) with these ones (¦) to get it working.
To put these into context, in your script they appear in two lines.
var iedom=document.all¦¦document.getElementById
and
if (iedom¦¦document.layers)
This is more likely to be an artefact of the transition from your HTML document to this forum post than a bug in your source code. Could be worth checking though.
Having got this sorted, your slide show works on my machine (albeit without any pictures as I don't have them here:-) )
Obviously the menus still don't as I don't have the source code for your menus. Hence, I haven't a snowball in hells chance of getting any further.
What I'd suggest is that you use Firefox with the console2 extention. Open your page, go into the javascript console to see what errors are being reported.
You only need one syntax durning the loading phase to totally stop all further javascript dead in it's tracks.
I wonder if your problem is where you are placing the script in your document.
The document I have just created consists of:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
Followed by:
All of your script exactly as it appears in your first post (including the two script tags you provided in your second post)
Followed by:
<title></title>
</head>
<body>
</body>
</html>
From this you can see that I've put ALL of the script within the HEAD of the document. Are you perhaps including it somewhere in the body instead?
Before I made my last post, I did experiment with the script in the body and found it didn't work like that. I'll have a deeper poke, to see if I can work out what's at the root of the problem.
Your tags to your external scripts (those two that you gave in your second post) want to be in the head.
Next: In your first post you have a section that looks like
Menu:
<SCRIPT type=text/javascript>
function Go(){return}
</SCRIPT>
Remove this in it's entirety. It's overriding a function that is in your menu_com.js file.
Place all of the script for your slide show in the document body, where you want the slide show to be. (just as you suggested)
Now the Go function of your menu_com.js file needs to be called, but you can call this from your fillup function.
So where you have
function fillup(){
if (iedom){
etc...
You want
function fillup(){
Go()
if (iedom){
etc...
By the way, it is case sensitive so make it an uppercase G followed by a Lower case o(and then open and close brackets).