tad604
tad604

Reputation: 336

jQuery CSS positioning information not updating on Firefox

I have the following jsFiddle: http://jsfiddle.net/tad604/dpRca/2/

That works as desired on IE and Chrome, when it comes to Firefox it doesn't work right.

The desired behavior is to have a div (with the word foo) created where ever you click on the div containing the image.

With firefox the top/left positioning information is lost.

Upvotes: 1

Views: 118

Answers (1)

bobince
bobince

Reputation: 536675

"top":(ui.offsetY)+"px"

offsetX/offsetY (and the offsetParent they are calculated relative to) are non-standard event properties not available in Firefox.

Use clientX/clientY (standard) or pageX/pageY (typically more useful; populated by jQuery from clientX/Y where not natively available) instead.

Upvotes: 1

Related Questions