Beruflich Dokumente
Kultur Dokumente
At the head of your file you’ll want to add the following references…
<head>
</head>
The css contains sizing and display styles for the popup elements.
subModal.js is where all the action happens. Inside event handlers are attached for
the load and resize events of the browser. The load event initializes dhtml objects
that are reused when showing, hiding, or resizing the window.
The javascript file also inserts any HTML necessary for the subModal.
Now that everything’s in place all you have to do is add something that’s going to
call the function to show the modal.
The first argument is the file to load, followed by width and height (integers). Any
content that overflows these dimensions will scroll inside the modal, like a real
window.
The fourth argument allows you to pass a javascript function that will be called
when the window is closed – by calling hidePopWin(true). hidePopWin will not call
the return function by default. This is useful for cancel button functions.
function returnRefresh(returnVal) {
window.document.reload();
window.top.hidePopWin(true);
I’ve been using subModal as well, but there is a problem in Safari when the window
has an active scrollbar. The code used does not calculate the scroll amount so the
centering is off leaving uncovered areas of the original page.
scLeft = self.pageXOffset;
scTop = self.pageYOffset;
// Explorer 6 Strict
scLeft = document.documentElement.scrollLeft;
scTop = document.documentElement.scrollTop;
scLeft = document.body.scrollLeft;
scTop = document.body.scrollTop;