超链的文字说明显示到指定位置? 是否可以做到鼠标移动到<a href="www.baidu.com" title="baidu" onclick="search.php" target="_blank">baidu</a>时,title里的文字“baidu”不显示在超链位置,而显示到指定位置的DIV里面?注:a href和onclick都已经用满了 :( 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 onmouseover="document.getElementByID('指定divID').innerText='指定内容'" onmouseover="document.getElementByID('指定divID').innerText=this.title" 回3楼,只能把 '指定内容'放在innerText里吗?还有没有别的方法?我用的是PHP,<a href="www.baidu.com" title="baidu" onclick="search.php" target="_blank">baidu</a>写在了function函数里面。如果a href是数据库结果,JS代码是不能插进function代码里的吧。 <!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><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><script type="text/javascript" src="jquery-1.2.6.js"></script><script type="text/javascript">$(function(){ var x=10; var y=20; $("a").mouseover(function(e){ this.myTitle=this.title; this.title=""; var tooltip="<div id='tooltip'>"+this.myTitle+"<div>" $("body").append(tooltip); $("#tooltip").css({"top":(e.pageY+y)+"px","left":(e.pageX+x)+"px"}).show("fast"); }).mouseout(function(){ this.title=this.myTitle; $("#tooltip").remove(); });})</script></head><body><a href="" title="baidu" >hello</a></body></html>不知道楼主用JQuery了没有,看看这个对你有帮助没,可以通过样式来改div的位置和外观! JS数组移除元素 JS缓慢执行? 单击2个按钮没反应 如何在js里面判断正负数以及运算 JS如何实现控制DIV边角成圆角, javascript字符串连接,请人给我彻底讲讲 吃饭前提一个老问题,关于下拉列表的宽度问题 jquery如何获取当前触发事件的控件ID值 取datagrid中textbox的值,在ie下正常,但在netscape下出错,解决立即结贴!急!!! 复选框的问题,分类全选? js 兼容问题 求一句JQuery语句
我用的是PHP,<a href="www.baidu.com" title="baidu" onclick="search.php" target="_blank">baidu</a>写在了function函数里面。
如果a href是数据库结果,JS代码是不能插进function代码里的吧。
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript" src="jquery-1.2.6.js"></script>
<script type="text/javascript">
$(function(){
var x=10;
var y=20;
$("a").mouseover(function(e){
this.myTitle=this.title;
this.title="";
var tooltip="<div id='tooltip'>"+this.myTitle+"<div>"
$("body").append(tooltip);
$("#tooltip").css({"top":(e.pageY+y)+"px","left":(e.pageX+x)+"px"}).show("fast");
}).mouseout(function(){
this.title=this.myTitle;
$("#tooltip").remove();
});
})
</script>
</head><body>
<a href="" title="baidu" >hello</a>
</body>
</html>不知道楼主用JQuery了没有,看看这个对你有帮助没,可以通过样式来改div的位置和外观!