日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 前端技术 > HTML >内容正文

HTML

html滚动字幕如何向下移动,按向下键的同时,菜单选项向下移动,浏览器右边的滚动条也跟着跑怎么办。这个bug怎么改...

發布時間:2025/3/11 HTML 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 html滚动字幕如何向下移动,按向下键的同时,菜单选项向下移动,浏览器右边的滚动条也跟着跑怎么办。这个bug怎么改... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

是事件冒泡的鍋嗎?若果是,cancelbubble加到哪一行下面?若果不是應該怎么改.

下拉菜單

body,ul,li{ margin:0; padding:0; font-size:13px;}

ul,li{list-style:none;}

#divselect{width:186px; margin:80px auto; position:relative; z-index:10000;}

#divselect cite{width:150px; height:24px;line-height:24px; display:block; color:#807a62; cursor:pointer;font-style:normal;

padding-left:4px; padding-right:30px; border:1px solid #333333;

/*background:url(xjt.png) no-repeat right center;*/}

#divselect ul{width:184px;border:1px solid #333333; background-color:#ffffff; position:absolute; z-index:20000; margin-top:-1px; display:none;}

#divselect ul li{height:24px; line-height:24px;}

#divselect ul li a{display:block; height:24px; color:#333333; text-decoration:none; padding-left:10px; padding-right:10px;}

window.οnlοad=function(){

var box=document.getElementById('divselect'),

title=box.getElementsByTagName('cite')[0],

menu=box.getElementsByTagName('ul')[0],

as=box.getElementsByTagName('a'),

index=-1;

// 點擊三角時

title.οnclick=function(event){

event = event||window.event;

menu.style.display = 'block';

if(event.stopPropagation){

event.stopPropagation();

}else{

event.cancelBubble = true;

}

document.onkeyup = function(event){

event = event||window.event;

if(event.keyCode==40){

index++;

if(index>=as.length) index=0;

for(var i=0; i

as[i].style.background = '#fff';

}

as[index].style.background = '#ccc';

}

if(event.keyCode==38){

index--;

if(index<0) index=as.length-1;

for(var i=0; i

as[i].style.background = '#fff';

}

as[index].style.background = '#ccc';

}

if(event.keyCode==13){

for(var i=0; i

as[i].style.background = '#fff';

}

title.innerHTML = as[index].innerHTML;

menu.style.display = 'none';

}

}

}

// 滑過滑過、離開、點擊每個選項時

for(var i=0; i

as[i].num = i

as[i].onmouseover = function(){

this.style.background = '#ccc'

index = as[i].num-1;

}

as[i].onmouseout = function(){

this.style.background = '#fff'

}

as[i].onclick = function(event){

event = event||window.event;

if(event.stopPropagation){

event.stopPropagation();

}else{

event.cancelBubble = true;

}

menu.style.display = 'none';

title.innerHTML = this.innerHTML;

}

}

// 點擊頁面空白處時

document.onclick = function(){

menu.style.display = 'none';

}

}

請選擇分類

  • ASP開發
  • .NET開發
  • PHP開發
  • Javascript開發
  • Java特效

總結

以上是生活随笔為你收集整理的html滚动字幕如何向下移动,按向下键的同时,菜单选项向下移动,浏览器右边的滚动条也跟着跑怎么办。这个bug怎么改...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。