开发者

How to get location of clicked link on webpage in form of margins?

开发者 https://www.devze.com 2023-03-15 18:57 出处:网络
I have a link on webpage. When I click this link a pop is appeared using CSS. For example: <a href=\"/popup/show.php?marLft=950&marTo开发者_如何学Pythonp=400\" id=\"MyId\" class=\"MyClass\"&g

I have a link on webpage. When I click this link a pop is appeared using CSS.

For example:

<a href="/popup/show.php?marLft=950&marTo开发者_如何学Pythonp=400" id="MyId" class="MyClass">Show Popup</a>

I use marLft and marTop to set a css margins and Popup is shown on correct location under link.

Problem:

Now problem is that now I have some DIVs on webpage that are using jQuery fadeIn and fadeOut functionality. So location of Show Popup link is not same all the time and popup is not shown under the link always. How can I get location of link and pass that location in form of top and left margins to the linked script at runtime.

How it is possible.

Thanks


http://api.jquery.com/offset/

I think it you will help you.

0

精彩评论

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

关注公众号