The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Tooltip positioning issue...

Hello guys,

I recently put together a dynamic tooltip using ajax. It works great in IE and Firefox, but on Safari I am getting a strange positioning issue and I"m not sure why.

Basically if I activate the tooltip above the fold it works exactly as it should. If I scroll the page down however and then activate a link that utilizes the tooltip script, the tooltip is displayed around 150px away from the mouse which causes all sorts of problems.

As I mentioned it is designed to display the tooltip at the mouse point and it works great in every browser other than Safari. Here is the code:

I think the issue is obviously something with my positioning code but I really don't know what to do to fix it. Hopefully someone out there has had a similiar experiencing working with tooltips on a Mac and can help.

I didn't test this so I'm not sure if it would work, but I did solve the issue by doing some browser checking and conditional statements. I wasn't aware that Safari has a bug in the implementation of clientX and clientY and you need to use pageX and pageY instead which is what I ended up doing. Updated code below for those who may need it in the future: