用JS实现:鼠标移动到一张图片上,在原位置上显示另外一张图片,并在图片上出现可以超链接的文字
解决方案 »
- json格式数据如何显示在fusionchart中
- freemark页面动态插入数据后遇到的问题
- 请教一网站目录浏览问题
- 金山的注册页面 不用提交可以检验 用户id是否被注册。。。里面有网站连接,谁帮我看看谢谢啊?要是知道告诉我,这是javascript的那方面的
- 请问大家调试JavaScript都用了什么工具?
- 告急,字符的输入。
- 很简单的Javascript,很容易的,关于window.open()的用法。
- 控制弹出窗口的风格!高手帮忙
- 一个小问题 急待解决
- 请教大侠关于JS计算问题
- 【代码分享】一个javascript实现简易的代码高亮模块。
- 关于PagingMemoryProxy()一次读取XML中数据问题
<img src="http://t3.baidu.com/it/u=2067536300,3086431432&fm=13&gp=0.jpg" onmouseover="ChangeImg(this,'要显示的文字');" />
<a href="http://www.baidu.com"><span id="spanFont"></span></a>
</div> <script type="text/javascript">
function ChangeImg(img,font) {
spanFont.innerText = font;
spanFont.style.display = "block";
img.src = "http://t3.baidu.com/it/u=1853483217,2998772967&fm=13&gp=0.jpg";
}
</script>
<script type="text/javascript">
function ChangeImg(img,font) {
spanFont.innerText = font;
spanFont.style.display = "block";
if(img.src=="http://t3.baidu.com/it/u=1853483217,2998772967&fm=13&gp=0.jpg"
) return;
img.src = "http://t3.baidu.com/it/u=1853483217,2998772967&fm=13&gp=0.jpg";
}
</script>
这样,
<script>
var shuoming=document.createElement("div");
var text=document.getElementById("textid");
boolean sign=true;
function show(){
sign=false;
text.parentNode.appendChild(shuoming);
shuoming.style.top=parseInt(text.style.top)+10+"px";
shuoming.style.left=parseInt(text.style.left)+10+"px";
shuoming.style.zIndex=3;//大于1即可
}
function hide(){
if(!sign){
text.parentNode.removeChild(shuoming);
}
}
</script>必要时可添加classname,通过css操控
a:link {width:100px;height:50px;background:url('http://www.baidu.com/img/baidu_jgylogo3.gif');text-align:center;line-height:50px;font-size:1px}
a:hover {background:url('http://www.google.com.hk/images/nav_logo83.png');color:red;font-size:18px;font-weight:bold;}
</style>
<a href="链接">链接文字</a>