views:

9

answers:

1

Hi All,

OK...here goes. I am working on a bespoke intranet system which has a holiday calendar. This page is quite long and requires scrolling. This is where the problem comes in.

If I scroll down the page in IE(company policy) then click a day(this is a table cell)...a pop-up(div) should show up where I clicked. Now it shows up, but at the top of the page. Ideally its supposed to display where I click...

Any help is greatly appreciated as I'm a JavaScript & Jquery novice

Thanks

+1  A: 

http://api.jquery.com/scrollTop/

Description: Get the current vertical position of the scroll bar for the first element in the set of matched elements.

I guess you need:

var offset = $(window).scrollTop()

Another approach would be reading your jQuery Event:

 $("a").click( function( jQueryEvent )
 {
     var offset = jQueryEvent.pageY;
 }) 
Ghommey
@Ghommey, I tried implementing your solution but it hasn't worked
Nasir
@Nasir, What did not work?
Ghommey