⑴ easyui如何通過js設置滑鼠懸浮提示相應的信息
開始將div設為display="none"
$('#(懸浮的id)').mouseover(function(){
$('#(div的ID)').show();
});
$('#(懸浮的id)').mouseout(function(){
$('#(div的ID)').hide();
});
⑵ js,jsp,html,如何實現滑鼠放上去,會彈出一個提示框出來
<html>
<head>
<title>test</title>
<style>
body {font-size:12px;background:#9EC7E7}
</style>
<script type="text/javascript">
function news(type){
for(i=1;i<=5;i++){
if(i==type){
document.getElementById(type).style.display="block";
}else{
document.getElementById(i).style.display="none";
}
}
}
</script>
</head>
<body >
<table>
<tr>
<td>
<div style="border:0px solid red;height:95px;width:250px;font-size:30;background:#FFFFFF" align="center" onclick="news(1)">
最新動態
</div>
<div style="border:0px solid red;height:95px;width:250px;background:#DE77D0" align="center" onclick="news(2)">1
</div>
<div style="border:0px solid red;height:95px;width:250px;background:#E29529" align="center" onclick="news(3)">2
</div>
<div style="border:0px solid red;height:95px;width:250px;background:#DE77D0" align="center" onclick="news(4)">3
</div>
<div style="border:0px solid red;height:95px;width:250px;background:#E29529" align="center" onclick="news(5)">4
</div>
</td>
<td width="230"></td>
<td>
<div id="1" style="border:1px solid #C7B1B3;height:125px;width:250px;">最新動態</div>
<div id="2" style="border:1px solid #C7B1B3;height:125px;width:250px;display:none;">1</div>
<div id="3" style="border:1px solid #C7B1B3;height:125px;width:250px;display:none;">2</div>
<div id="4" style="border:1px solid #C7B1B3;height:125px;width:250px;display:none;">3</div>
<div id="5" style="border:1px solid #C7B1B3;height:125px;width:250px;display:none;">4</div>
</td>
</tr>
</table>
</body>
</html>
把onclick 換成onmouseover就可以了
⑶ 求 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支持
⑷ js 文字超出長度用省略號代替,滑鼠懸停並以懸浮框顯示
<!DOCTYPEhtml>
<html>
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=UTF-8">
<title>
RunJS演示代碼
</title>
<style>
#content{
text-overflow:ellipsis;
overflow:hidden;
white-space:nowrap;
width:200px;
}
</style>
<script>
onload=function(){
content.onmouseover=function(){
this.title=this.innerHTML;
}
}
</script>
</head>
<body>
<divid='content'>
js文字超出長度用省略號代替,滑鼠懸停並以懸浮框顯示
js文字超出長度用省略號代替,滑鼠懸停並以懸浮框顯示
js文字超出長度用省略號代替,滑鼠懸停並以懸浮框顯示
js文字超出長度用省略號代替,滑鼠懸停並以懸浮框顯示
</div>
</body>
</html>
⑸ 怎麼寫js讓滑鼠懸停在圖片上出現一段問題提示啊
<img>標簽裡面有這個屬性alt可以顯示提示信息,不需要用到js
用法:<img src="images/1.png" alt="這是一個圖片" />
⑹ 怎麼用JavaScript實現滑鼠放上去有提示框
<html>
<head>
<script language="LiveScript">
<!-- Hiding
function hello() {
alert("哈羅!");
}
</script>
</head>
<body>
<a href="" onMouseOver="hello()">link</a>
</body>
</html>
你試一下。希望能幫到你!