PDA

View Full Version : Slide-In Menu Bar I (trouble)



HockeyFan
09-27-2005, 09:19 PM
http://www.dynamicdrive.com/dynamicindex1/slideinmenu.htm

That is what I wanted to do except mine is more complicated because I have to create it from ASP (vb6). I did the following, and for some reason, it doesn't bring up the sliding menu.


<script language="JavaScript1.2">
/*******************************************
* Sliding Menu Bar Script = @ Dynamic Drive (www.dynamicdrive.com)
* Visit http://www.dynamicdrive.com/ for full source code
* This notice must stay intact for use
***************************************************************/

var slidemenu_width='160px'
var slidemenu_reveal='12px'
var slidemenu_top='170px'

var ns4=document.layers?1:0
var ie4=document.all
var ns6=document.getElementById&&!document.all?1:0

if (ie4||ns6)
document.write('<div id="slidemenubar2"
style="left:'+((parseInt(slidemenu_width)-parseInt(slidemenu_reveal))*-1)+'px;
top:'+slidemenu_top+';
width:'+slidemenu_width+' " onMouseOver="pull()"
onMouseout="draw()">')
else if (ns4){
document.write('<style>\n
#slidemenubar{ width:'+slidemenu_width+';}\n
<\/style>\n')
document.write('<layer id="slidemenubar" left=0
top='+slidemenu_top+' width='+slidemenu_width+'
onMouseOver="pull()" onMouseOut="draw()" visibility=hide>')
}

document.write('<Form Method="Post" Name="frmSelectDate" Action="LVUCWeb.asp?OP=DateSelect">
')
document.write('This is a test')
document.write('<\/Form>

function regenerate(){
window.location.reload()
}
function regenerate2(){
if (ns4){
document.slidemenubar.left=((parseInt(slidemenu_width)-parseInt(slidemenu_reveal))*-1)
document.slidemenubar.visibility="show"
setTimeout("window.onresize=regenerate",400)
} }

window.onload=regenerate2

rightboundary=0
leftboundary=(parseInt(slidemenu_width)-parseInt(slidemenu_reveal))*-1

if (ie4||ns6){
document.write('</div>')
themenu=(ns6)? document.getElementById("slidemenubar2").style :
document.all.slidemenubar2.style
}
else if (ns4){
document.write('</layer>')
themenu=document.layers.slidemenubar
}

function pull(){
if (window.drawit)
clearInterval(drawit)
pullit=setInterval("pullengine()",10)
}

function draw() {
clearInterval(pullit)
drawit=setInterval("drawengine()",10)
}

function pullengine(){
if ((ie4||ns6) && parseInt(themenu.left)<rightboundary)
themenu.left=parseInt(themenu.left)+10+"px"
else if (ns4 && themenu.left<rightboundary)
themenu.left+=10
else if (window.pullit){
themenu.left=0
clearInterval(pullit)
}
}

function drawengine(){
if ((ie4||ns6) && parseInt(themenu.left)>leftboundary)
themenu.left=parseInt(themenu.left)-10+"px"
else if (ns4 && themenu.left>leftboundary)
themenu.left-=10
else if (window.drawit){
themenu.left=leftboundary
clearInterval(drawit)
}
}
</script>

The original works, obviously, and it works great, but for some reason, the version that I'm generating from ASP isn't even close. I sure hope someone can help me.