ASP.NET modal popupextender - scroll with page behind

Hi experts,

I am using several ASP.NET modal popupextenders to display various information on my site. They all work fine, but one thing that I dislike is that if the modal is open and I scroll the mouse, the modal stays where it is and the page behind (the browser window) scrolls instead. I would prefer the modal to scroll WITH the page.

Can this be done?

Thanks

Jon
LVL 11
Jon WinterburnAsked:
Who is Participating?
 
masterpassCommented:
Give RepositionMode="None"

Now in the panel, apply the style like this (panel will the same as PopupControlID of the modalpopupextender)

style="position:absolute !important;"

NB: This won't work in IE7 as expected ...
0
 
meetingexpectationsCommented:
What do you mean? The modal is always visible on the top, right? no matter how the page scrolls? You can also set the properties for modalpopupextender:
•X - The X coordinate of the top/left corner of the modal popup (the popup will be centered horizontally if not specified)
•Y - The Y coordinate of the top/left corner of the modal popup (the popup will be centered vertically if not specified)
0
 
Jon WinterburnAuthor Commented:
No, I mean the modal is visible in the centre of the page, which is perfect. But if I scroll the mousewheel, the modal stays exactly where it is, yet the page behind (greyed out and inaccessible whilst modal is visible) scrolls. I want the modal to scroll with the page.
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
meetingexpectationsCommented:
The modal is scrolling with the page, that is why it is visible. Say you have a very long page....When the modal is open, you scroll the background page, the modal scrolls with the page and you still see the modal. Otherwise, you would just see the background page and the modal would be sitting somewhere on the top...
0
 
Jon WinterburnAuthor Commented:
That's the point - it's not scrolling with the page, it's fixed. I want it to be like you said - where if you scrolled a loooong page, the modal would be sitting somewhere on top. Thing is, the pages I use this on are not long, so that's not an issue. But the problem occurs if the user has their browser not full size (perhaps half-size) or their resolution low. I want the user to be able to scroll and the modal move with the page.
0
 
meetingexpectationsCommented:
The modal will show always on the top. Now you can set the X and Y co-ordinates as mentioned above and that will make the modal visible no matter what the browser size....
0
 
masterpassCommented:
But the problem occurs if the user has their browser not full size (perhaps half-size) or their resolution low ----------->

In your Modalpopextender, set the RepositionMode
RepositionMode="RepositionOnWindowResizeAndScroll"

Open in new window

0
 
Jon WinterburnAuthor Commented:
Thanks masterpass, but it doesn't seem to make any difference.

An example of what I want to achieve is visible on one of my favourite websites. Look at: http://www.barryhutchison.com/2009/08/5-page-gangrene-preview/ and click on any picture, then scroll the mouse. You will see that the popup is attached to the background window, so it scrolls WITH the background window, rather than what my modalpopupextender does which is stay put in one location whilst the background window scrolls.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.