Alexandre Plennevaux wrote:
> Great work!! I'll try it out today !
>
> Question: is it possible, when modal window is shown, that the browser
> scrollbar be hidden?
> For instance, i think it would mean: store the current scroll position,
> store current body display style value, set
> document.body.style.overflow="hidden" (if it is not), and on closing the
> modal window, restore the document.body to its initial display value.
>
> Possible?
>
Alexandre,
This is very possible. I don't think I'll include it in the code base,
because my goal is to remain as unobtrusive as possible -- less is more.
You can edit the code to do this, or accomplish it in a callback
function (that would be my choice). I don't yet have an example of
callbacks on the page, so I'll provide a brief one here;
$('#modalWindow').jqm({
focus: true
}, myCallBack);
function myCallBack(modalWindow,serial) {
// execution flow will reach here when the window is displayed/opened
// @modalWindow is the window element (in this case, it would be
#modalWindow)
// @serial is the serial of this window. This is useful for
accessing the "hash" which holds overlay, settings, etc. The hash for
this window is accessed via $.jqm.hash[serial] -- e.g.
$.jqm.hash[serial].o would be the overlay element(s).
...
}
If you'd like to modify code, you'll want to work in the "if (c.focus)
{" section of the open function, and again in the close function.
Although I wouldn't recommend this route.. as you'll have to re-apply
your changes on every update.. and I foresee a few more updates as this
is a new plugin ;)
Also.. I made the silly decision to do away with an on window close
callback, as I couldn't think of uses ;( -- In the next update I'll
include the onClose callback, as well as passing the window's hash
instead serial (after all, what else would you need the serial for?).
Thanks for the interest.
~ Brice
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/