[jQuery] getting new window to appear at mouse click coordinates
I need to have a window appear at the exact location of the link that
I click (so its not floating in the middle of the page or something).
Can someone help me out? Thanks.
<script src="jquery-1.2.6.min.js" type="text/javascript"></script>
<script src="jqModal.js" type="text/javascript"></script>
<script src="jqDnR.js" type="text/javascript"></script>
<script type="text/javascript">
// this example shows the use of onShow and onHide callbacks. Make
// sure to read the documentation for futher instructions, and
// an explanation of the "hash" argument.
$().ready(function() {
$().mousemove(function(e) {
$('#ex3c')
.jqDrag('.jqDrag')
.jqResize('.jqResize')
.jqm({
trigger:'#ex3cTrigger',
overlay: 0,
onShow: function(h) {
/* callback executed when a trigger click. Show notice */
h.w.css('left',e.pageX + 'px');
h.w.css('top',e.pageY + 'px');
h.w.css('opacity',0.92).slideDown();
},
onHide: function(h) {
/* callback executed on window hide. Hide notice, overlay.
*/
h.w.fadeOut("slow",function() { if(h.o)
h.o.remove(); }); }
});
setTimeout('#ex3c', 1000);
});
});
</script>
<a href="#" id="ex3cTrigger">view</a>
<div class="windowLocation">
<div id="ex3c" class="jqmNotice">
<div class="jqmnTitle jqDrag">
<h1>Did you know?</h1>
</div>
<div class="jqmnContent">
Pine, spruce, or other evergreen wood should never be used in
barbecues. These woods, when burning or smoking, can add harmful tar
and resins to the food. Only hardwoods should be used for smoking and
grilling, such as oak, pecan, hickory, maple, cherry, alder, apple, or
mesquite, depending on the type of meat being cooked.
</div>
<img src="close_icon.png" alt="close" class="jqmClose" />
<img src="resize.gif" alt="resize" class="jqResize" />
</div>
</div>