开发者

jQuery common popup for a set of elements

开发者 https://www.devze.com 2023-02-11 12:48 出处:网络
I want a popup so that I\'m listing a lot of co开发者_如何学Cntacts and there is a provision for sending messages. Can I use a single popup and move it around the DOM such that when I click on a send

I want a popup so that I'm listing a lot of co开发者_如何学Cntacts and there is a provision for sending messages. Can I use a single popup and move it around the DOM such that when I click on a send message link the popup will be shown near the link I googled and searched for it a while couldn't see a modal.


You can set the location of the dialog result using

$( ".selector" ).dialog( "option", "position", [200,300] );

And you can get the mouse pointer location (which assuming the link is near the contact will be approximately the right location (you might need to tweek it)) so would something like this do the trick:

$( ".selector" ).dialog( "option", "position", [window.event.clientX,window.event.clientY]);

$( ".selector" ).dialog( "option", "open");

position --> http://jqueryui.com/demos/dialog/#option-position

mouse --> http://www.devx.com/tips/Tip/29285

0

精彩评论

暂无评论...
验证码 换一张
取 消