如何使弹出窗口悬停在
jquery中的链接上?
- <div id="floatbar">
- <a href="" onclick="make it float 10px under this yay">
- </div>
解决方法
jquery
- $("#floatbar").click(function(e){
- e.preventDefault();
- $(this).find(".popup").fadeIn("slow");
- });
css
- #floatbar {
- position:relative;
- }
- .popup {
- position:absolute;
- top:10px;
- left:0px;
- height:30px;
- background:#ccc;
- display:none;
- }
HTML
- <a id="floatbar" href="#">
- <div class="popup">Hi there</div>
- click here
- </a>