我有这个需要更改OnMouseOver的脚本,目前它在你点击时起作用但我需要它在鼠标光标越过div时起作用.任何帮助是极大的赞赏.
<script>
// execute your scripts when the DOM is ready. this is a good habit
$(function() {
// assign a click event to the exposed element, using normal jQuery coding
$("#menuwrapper").mouseOver(function() {
// perform exposing for the clicked element
$(this).expose();
});
});
</script>
Run Code Online (Sandbox Code Playgroud) 我用一条jQuery线来碰到一个墙,以显示和隐藏潜水.我正在使用一个链接(阅读更多...)来显示div,并在div中向底部我有一个紧密的链接.
show函数工作正常,但关闭div时关闭功能不会缓慢生成动画并导致页面滚动条一直向上移动.我认为它可能与我编码的方式中的错误有关,因为我对jQuery很新.任何帮助,将不胜感激.
我正在使用jQuery版本1.6.4
jQuery代码:
$(document).ready(function(){
$(".toggle_container").hide();
$("#standard_or_custom").hide();
$("a.trigger").toggle(function(){
$(this).addClass("active");
}, function () {
$(this).removeClass("active");
});
$("a.trigger").click(function(){
$(this).next(".toggle_container").slideToggle("slow,");
});
$("a.close").click(function(){
$(".toggle_container").hide("slow,");
});
});
Run Code Online (Sandbox Code Playgroud)
HTML:
<a href="#" class="trigger">Read more...</a>
<div class="toggle_container">
<p>
CONTENT HERE
</p>
<a href="#" class="close">Close</a>
</div>
Run Code Online (Sandbox Code Playgroud)
我使用的CSS与此div相关:
.toggle_container {
margin:0;
padding:10px 10px;
border: 1px solid #d6d6d6;
background: #f1f1f1;
overflow: hidden;
font-size:.95em;
clear: both;
}
.toggle_container .block {
padding: 20px;
}
.toggle_container .block p {
padding: 5px 0;
margin: 5px 0;
}
.bottom {
margin-bottom:20px;
}
Run Code Online (Sandbox Code Playgroud)