problem with my logic and pageY
I want the div to open near where it was clicked it contains a form, and the page could be 1400px high or 600px high. The trouble is with the code I have is the first click opens the div at the top of the containing div (not where it should) if that is closed and re-clicked it opens where I want it placed.
Here's my code:
- $(function()
- {
- updateMtg = function()
- {
- $(".updateMtgY").click(function(e){
- var yPos = (e.pageY-320)+'px';
- $("#updateFormHolder").css({top:yPos})
- })
- $("#updateFormHolder").show();
- $.ajax({
- url: "pu/updateMtgForm.php",
- cache: false,
- dataType: "html",
- success: function(data) {
- $("#updateFormHolder").html(data);
- }
- });
- }
- });
Thanks
--Jim