<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<title>Меню в форме стабильно при прокрутке</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<style type="text/css">
#visiblecombo{
position: fixed;
visibility: hidden;
}
* html #visiblecombo{
display: none;
}
#visiblecombo select{
background-color: lightyellow;
}
#visiblecombo .gobutton{
font-weight: bold;
padding: 0 3px;
text-decoration: none;
}
#visiblecombo .gobutton:hover{
background-color: #FFE242;
}
}
</style>
<script type="text/javascript">
var alwayscombo={
location: ["top", "right"],
addoffset: [10, 15],
comboid: "visiblecombo",
navigate:function(){
var selectobj=this.comboref.getElementsByTagName("select")[0]
if (selectobj.options[selectobj.selectedIndex].value!="default")
window.location=selectobj.options[selectobj.selectedIndex].value
},
floatcombo:function(){
var docElement=(document.compatMode=='CSS1Compat')? document.documentElement: document.body
if (this.location[0]=="top")
this.comboref.style.top=0+this.addoffset[0]+"px"
else if (this.location[0]=="bottom")
this.comboref.style.bottom=0+this.addoffset[0]+"px"
if (this.location[1]=="left")
this.comboref.style.left=0+this.addoffset[1]+"px"
else if (this.location[1]=="right")
this.comboref.style.right=0+this.addoffset[1]+"px"
},
init:function(){
this.comboref=document.getElementById(this.comboid)
this.comboref.style.visibility="visible"
this.floatcombo()
}}
if (window.addEventListener)
window.addEventListener("load", function(){alwayscombo.init()}, false)
else if (window.attachEvent)
window.attachEvent("onload", function(){alwayscombo.init()})
</script>
</head>
<body>
<form>
<div id="visiblecombo">
<select size="1" onChange="alwayscombo.navigate()">
<option value="default" selected="true" style="background-color: #532900; color: white;">--SELECT AN OPTION--</option>
<option value="http://www.javascriptkit.com">JavaScript Kit</option>
<option value="http://www.javascriptkit.com/jsref/">JavaScript Reference</option>
<option value="http://www.javascriptkit.com/domref/">DOM Reference</option>
<option value="http://www.codingforums.com">CodingForums.com</option>
<option value="http://www.cssdrive.com">CSS Drive</option>
<option value="http://www.dynamicdrive.com">Dynamic Drive</option>
</select>
<a href="#" onClick="alwayscombo.navigate(); return false" class="gobutton">Go</a>
</div>
</form>
<pre>
</pre>
</body>
</html>