Данило Кубай's Library tagged → View Popular
14 Jun 09
justaddwater.dk | Design for Browser Size — Not Screen Size
1024×768 screen resolution gives 1004×598 usable content
area (maximized Internet Explorer window, Windows XP)
-
1024×768 screen resolution gives 1004×598 usable content
area
[jQuery] Re: Center a Div
Vertically centering div in viewport with jqwery
-
I think you're mistaken about where the preloader will show up.
click on a "center" button, and see where the div goes
Take a look at the demo page I put together:
http://test.learningjquery.com/center.html -
// vertically center something in the viewport
return window.innerHeight - (($
(function($){
$.fn.vCenter = function(options) {
var pos = {
sTop : function() {
return window.pageYOffset || $.boxModel &&
document.documentElement.scrollTop || document.body.scrollTop;
},
wHeight : function() {
if ( $.browser.opera || ($.browser.safari && parseInt
($.browser.version) > 520) ) {
(document).height() >window.innerHeight) ? getScrollbarWidth() : 0);
} else if ( $.browser.safari ) {
return window.innerHeight;
} else {
return $.boxModel && document.documentElement.clientHeight
|| document.body.clientHeight;
}
}
};
return this.each(function(index) {
if (index == 0) {
var $this = $(this);
var elHeight = $this.height();
$this.css({
position: 'absolute',
marginTop: '0',
top: pos.sTop() + (pos.wHeight() / 2) - (elHeight / 2)
});
}
});
};
})(jQuery);
// center an element
$(document).ready(function() {
$('#foo').vCenter();
});
--Karl
_________________
Karl Swedbergwww.englishrules.comwww.learningjquery.com
23 Feb 08
document.body, doctype switching, and more | evolt.org
-
document.body, doctype switching, and more
Selected Tags
Related Tags
Sponsored Links
Ads by Google
Top Contributors
Groups interested in layout
Related Lists on Diigo
-
Typography
All about my passion for cl...
Items: 2 | Visits: 87
Created by: Bert Deckers
-
CSS: Techniques, Tips and Tactics
A list to support the Netsk...
Items: 29 | Visits: 124
Created by: Will Allen
-
WebKit and the Future of the Open Web
WebKit is an advanced HTML-...
Items: 20 | Visits: 104
Created by: Gary Edwards
Diigo is about better ways to research, share and collaborate on information. Learn more »
Join Diigo
