用js的怎么样?固定在顶部的那种,和ie浏览器类似!!
解决方案 »
- 求高手指点用ajax获取的数据来操作页面的相关代码
- 请问javascript类型问题?
- 弹出层操作
- 问一js日期选择的问题
- 求助:如何区分访问站点的设备是android还是androidpad?
- 关于showmodaldialog的窗口,在窗口中怎么控制它的大小??
- 各位兄弟问一下,我怎样才能动态显示一个层!
- 教材方案,各位帮忙
- 一个下拉列表和一个文本框,怎样把下拉列表的值填入文本框?
- 如何才能在自己网页嵌入其它网站的即时信息,如天气预报
- 我有一个js做的菜单程序,点击后我想出现一个新窗口,大侠赐教!!源码如下。
- 菜鸟问题:这段代码是javascript吗?我写了language=javascript就不能运行!不是是什么?
利用层地浮动
只要把里面地东东改为下拉菜单就可以了,一些参数自己重设一下<div id="KBStatic" style="position: absolute; left: 50; top: 0; width: 400; height: 45; z-index: 25">
<embed src='Mp3/1207_2002920202.mp3' width=400 height=45 autostart=true loop=true> </div>
<script language=JavaScript>
function KB_keepItInIE(theName,theWantTop,theWantLeft)
{
theRealTop=parseInt(document.body.scrollTop)
theTrueTop=theWantTop+theRealTop
document.all[theName].style.top=theTrueTop
theRealLeft=parseInt(document.body.scrollLeft)
theTrueLeft=theWantLeft+theRealLeft
document.all[theName].style.left=theTrueLeft
}
function KB_keepItInNN(theName,theWantX,theWantY)
{
theRealLay=document.layers[theName]
theBadX=self.pageYOffset
theBadY=self.pageXOffset
theRealX=theBadX+theWantX
theRealY=theBadY+theWantY
theRealLay.moveTo(theRealY,theRealX)
}
IE4=(document.all)?1:0
NN4=(document.layers)?1:0
if (IE4)
setInterval('KB_keepItInIE("KBStatic",0,50)',1)
if (NN4)
setInterval('KB_keepItInNN("KBStatic",0,50)',1)
</script>
display:none
只要把display显示方式改一下即可
<div id="KBStatic" style="position: absolute; left: 50; top: 0; width: 400; height: 45; z-index: 25;">
<embed src='Mp3/1207_2002920202.mp3' width=400 height=45 autostart=true loop=true> <a href="#" onclick="javascript:self.KBStatic.style.display='none'">关闭</a></div>