作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试创建一个文本链接,当鼠标悬停在顶部时,它会变成 3 个显示社交网络的图标。当鼠标悬停在图标上时,图标必须在那里,当鼠标移开时,图标会消失并变为文本链接状态。
这是我的 fiddle ( http://jsfiddle.net/eccg8/1/ )。我有一些功能,但它有问题。鼠标移动时图标消失,静止时图标闪烁
感谢帮助
这是html
<div id="text_links">
<a href="#" id="projects_link" class="menu_link">PROJECTS</a>
<a href="#" id="contact" class="menu_link">CONTACT</a>
<a href="#" id="social" class="menu_link">FOLLOW US</a>
</div>
<div id="social_buttons">
<a href="#" id="skype"><img src="http://ticketcomunicacion.com/ticket/data/social/facebook-logo.png" id="skype-btn"></a>
<a href="#" id="tumblr"><img src="http://ticketcomunicacion.com/ticket/data/social/facebook-logo.png" id="tumblr-btn"></a>
<a href="#" id="facebook"><img src="http://ticketcomunicacion.com/ticket/data/social/facebook-logo.png" id="facebook-btn"></a>
</div>
CSS
.menu_link {
margin-right: 10px;
color: red;
font-weight: bold;
}
#skype-btn, #facebook-btn, #tumblr-btn {
width: 24px;
}
#social_buttons {
position: absolute;
right: 260px;
top: 5px;
}
.hidden { display: none !important; }
和 JQuery
$().ready(function() {
$("#social_buttons").hide();
$( "#social" ).mouseover(function() {
$("#social").addClass("hidden");
$("#social_buttons").fadeIn("slow");
setTimeout(function(){
$("#social_buttons").hide();
$("#social").removeClass("hidden");
}, 5000);
});
var s = null;
$( "#social_buttons" ).mouseout(function() {
clearTimeout(s);
$("#social_buttons").hide();
s = setTimeout('$("#social").removeClass("hidden");', 100);
});
});
最佳答案
当鼠标悬停在社交按钮上时试试这个:
$( "#social_buttons" ).mouseout(function() {
clearTimeout(s);
$(this).hide();
//$("#social").removeClass("hidden");
s = setTimeout('$("#social").removeClass("hidden");', 100);
});
关于javascript - 将悬停图标的文本更改为鼠标移出图标上的文本 - JQuery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20714453/
我正在做一个项目,我的 android 在这个项目中作为一个网络服务器工作;输入带端口号的 IP 地址,打开 Web 界面,用户可以将文件上传到手机。我想在 Web 界面上显示一些图片,以便我们的界面
我是一名优秀的程序员,十分优秀!