Please help Slight change for jquery popup
Hi! i just want that the link inside the popup should also close the popup, (not only when clicked elswhere)
what code and here do i put the code for the id#cls, that should also close the popup.
Thanks so much
<script type="text/javascript" src="jquery-1.js"></script>
</head><body>
<p>Some text</p>
<p>some text</p>
<a href="#" id="button">Show popup</a>
<div id="bubble" style="padding: 20px; background:#666666; height: 27px; position: absolute; display: none;"> <a href="#" id="cls">also close from here </a>This is a test. When you click away, it will disappear.</div>
<p><script type="text/javascript">
jQuery(document).ready(function(){
jQuery("#button").bind("click", function(e) {
jQuery("#bubble").css({
left:jQuery(this).offset().left-5,
top:jQuery(this).offset().top-jQuery("#bubble").height()-35
}).show();
e.stopPropagation(); // Stops the following click function from being executed
jQuery(document).one("click", function(f) {
jQuery("#bubble").hide();
});
});
// STOP the menu from disappearing when it is clicked
jQuery("#bubble").bind("click", function(e) { e.stopPropagation(); });
});
</script></p>
</body></html>