Hi jQuerians,

a while back I posted an instruction of how to make Thickbox simpler and
smoother by using fixed positioning. But that applied only to the box
itself, not the overlay. There is still some overhead to compute the
dimensions of the overlay depending on the state of the viewport.

Today it came to my mind, that the same considerations as for the box
can be done for the overlay. So instead of doing some ugly dimensions
computing with three branches for different browsers just use fixed
positioning as well and make it 100% wide and high:

#TB_overlay {
     position: fixed;
     top: 0;
     left: 0;
     z-index: 9999;
     width: 100%;
     height: 100%;
     background-color: #eaf4f2;
     opacity: .4;
}

Throw away

function TB_overlaySize(){
...
}

and all references to it. Done (nearly)! The only thing we still need to
do is to accommodate IE6 with a little dynamic property:

* html #TB_overlay {
     position: absolute;
     height: expression(document.body.scrollHeight >
document.body.offsetHeight ? document.body.scrollHeight :
document.body.offsetHeight + 'px');
}

Use the Star Selector hack to exclude IE7.


If you like I can put *all* the changes together again or blog about it.


Cheers!

-- Klaus




_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to