切换文字与图片 [英] Toggle texts with image

查看:77
本文介绍了切换文字与图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<html>
<head>

<script src="script1/jquery-1.7.2.js" type="text/javascript"></script>
<script>
$(document).ready(function() {
$('.nav-toggle').mouseover(function(){
//get collapse content selector
var collapse_content_selector = $(this).attr('href');

//make the collapse content to be shown or hide
var toggle_switch = $(this);
$(collapse_content_selector).toggle(function(){
if($(this).css('display')=='none'){

}
});
});
$('.nav-toggle').mouseout(function(){
//get collapse content selector
var collapse_content_selector = $(this).attr('href');

//make the collapse content to be shown or hide
var toggle_switch = $(this);
$(collapse_content_selector).toggle(function(){
if($(this).css('display')=='none'){

}
});
});
});
</script>
</head>
<body>
<a href="sole.html" class="nav-toggle"><img src="images/12.jpg" width="298" height="59" alt="image">

<div id="collapse1" style="display:none">my text that is revealed is this section.....</div>
</body>
</html>




请帮助我,当鼠标悬停在图像上时,我无法切换图像以获取其后的文字..




Please help me i am unable to toggle the image to get the text behind that when mouseover on the image..

推荐答案

(document).ready(function(){
(document).ready(function() {


('.nav-toggle').mouseover(function(){ //获取折叠内容选择器 var crash_content_selector =
('.nav-toggle').mouseover(function(){ //get collapse content selector var collapse_content_selector =


(this).attr('href'); //使折叠内容显示或隐藏 var toggle_switch =
(this).attr('href'); //make the collapse content to be shown or hide var toggle_switch =


这篇关于切换文字与图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆