⑴ 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>
你试一下。希望能帮到你!