❶ js css 滑鼠移入某個區域滑出一個框的效果怎麼做
1、輸復入代碼,其中button是滑鼠要滑制動的地方,滑過button時,class為content的內容就要顯示出來,滑鼠滑出去的時候,這塊內容就需要重新隱藏起來。
❷ 請問高手,javaScript中如何出現一個浮在文字上面的提示框
簡單的話,直接價格title屬性就可以了,比如
。如果想定義這個提示框的樣式,可以定義個div將他的position設為absolute,display為none。然後給文字定義滑鼠在上面的事件onmouseover在事件里將display設為block。再加上滑鼠離開時的事件onmouseout,在事件里是display為none。
❸ js滑鼠移動到某元素顯示div的問題!
滑鼠經過彈出浮動框的效果,實現方法有多種,這里列舉2種常用的解決方法。代版碼直接貼上來權不能正常顯示,看附件。
方法A:
把浮動div和觸發元素a放於同一個父級元素內,滑鼠經過父級元素時觸發顯示。這樣滑鼠移動到div時仍然處於該父級元素內,則div不會隱藏。
方法B:
滑鼠經過a時彈出div,滑鼠離開a時設置一個計時器用來關閉div,如果滑鼠移動到div後則清除計時器。
❹ js 滑鼠滑過 顯示一個浮動層
自己看吧,代碼分離。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
body{
text-align:center;
padding-top:20%;
}
#menu{
margin:0 auto;
cursor:hand;
height:30px;
width:100px;
border:1px solid black;
background-color:white;
}
#menu div{
color:#444;
font-size:13px;
visibility:hidden;
position:relative;
height:20px;
width:98px;
border:1px solid green;
background-color:white;
margin-top:30px;
}
</style>
<script type="text/javascript">
function handleScroll(){
document.getElementById("menu").style.top = (document.body.offsetHeight*0.87 + document.body.scrollTop) +"px";
}
function pop(){
var toogle = document.getElementById("menu").childNodes[0];
if(toogle.style.visibility == "" || toogle.style.visibility == "hidden"){
toogle.style.visibility = "visible";
}else{
toogle.style.visibility = "hidden";
}
}
function init(){
document.body.onscroll="handleScroll()";
document.body.onload="handleScroll()";
document.getElementById("menu").onmouseover=pop;
document.getElementById("menu").onmouseout=pop;
}
window.onload=init;
</script>
</head>
<body>
<div id="menu"><div>彈出層</div></div>
</body>
</html>
❺ 怎麼用JavaScript實現滑鼠放上去有提示框
<html>
<head>
<script language="LiveScript">
<!-- Hiding
function hello() {
alert("哈羅!");
}
</script>
</head>
<body>
<a href="" onMouseOver="hello()">link</a>
</body>
</html>
你試一下。希望能幫到你!
❻ 如何用js實現滑鼠向上滾動時浮動導航
<script> var scrollFunc = function (e) { var direct = 0; e = e || window.event; if (e.wheelDelta) { //判斷瀏覽器IE,谷歌滑輪事件 if (e.wheelDelta > 0) { //當滑輪向上滾動時 alert("滑輪向上滾動"); } if (e.wheelDelta < 0) { //當滑輪向下滾動時 alert("滑輪向下滾動"); } } else if (e.detail) { //Firefox滑輪事件 if (e.detail> 0) { //當滑輪向上滾動時 alert("滑輪向上滾動"); } if (e.detail< 0) { //當滑輪向下滾動時 alert("滑輪向下滾動"); } } ScrollText(direct); } //給頁面綁定滑輪滾動事件 if (document.addEventListener) { document.addEventListener('DOMMouseScroll', scrollFunc, false); } //滾動滑輪觸發scrollFunc方法 window.onmousewheel = document.onmousewheel = scrollFunc; </script>
❼ 如何用js實現滑鼠向上滾動時浮動導航
<script>
varscrollFunc=function(e){
vardirect=0;
e=e||window.event;
if(e.wheelDelta){//判斷瀏覽器IE,谷歌滑輪事件
if(e.wheelDelta>0){//當滑輪向上滾動時
alert("滑輪向上滾動");
}
if(e.wheelDelta<0){//當滑輪向下滾動時
alert("滑輪向下滾動");
}
}elseif(e.detail){//Firefox滑輪事件
if(e.detail>0){//當滑輪向上滾動時
alert("滑輪向上滾動");
}
if(e.detail<0){//當滑輪向下滾動時
alert("滑輪向下滾動");
}
}
ScrollText(direct);
}
//給頁面綁定滑輪滾動事件
if(document.addEventListener){
document.addEventListener('DOMMouseScroll',scrollFunc,false);
}
//滾動滑輪觸發scrollFunc方法
window.onmousewheel=document.onmousewheel=scrollFunc;
</script>
❽ 網頁最右邊,滑鼠放上去彈出個框,如何js實現
實現代碼就不寫了。給你思路:
網頁最右邊你需要放上去彈出個框的位置定義一個div,有一定寬度,並且根據窗口大小獲得自動的100%高度,將這個div保持固定浮動fixed.在該div上加入滑鼠移入事件進行彈出則可。
原生 onmouseover
jq:hover
❾ js特效,就是滑鼠放的div上時,同時顯示一個浮動圖層,來顯示關閉和編輯此圖層中的內容
可以實現。。。。
滑鼠的hover事件裡面
❿ 求 js 特效,滑鼠滑過,顯示浮層
首先隨便找一個地抄方新建一個襲div 並且隱藏。例如
<div id='showTip' style="background-color: white; width:200px; height:200px;position: absolute; display: none; ">
</div>
然後在鏈接那邊寫個onmouseover 屬性加個觸發方法 如showDiv()具體方法如下
function showDiv(e){
$("#showTip").html("這里可以寫一些html的內容,如圖片文字");
$("#showTip").css("top",e.clientY);//這里可以根據情況適當調整
$("#showTip").css("left",e.clientX);
$("#showTip").show();
}
還要在鏈接那邊加上 onmouseout屬性觸發方法如下:
function hideDiv(){
$("#showTip").hide();
}
以上需要引入jquery支持