Skip to main content

Данило Кубай's Library tagged layout   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)

justaddwater.dk/...r-browser-size-not-screen-size - Preview

design webdesign web layout

  • 1024×768 screen resolution gives 1004×598 usable content

    area

[jQuery] Re: Center a Div

Vertically centering div in viewport with jqwery

www.mail-archive.com/...msg23370.html - Preview

jquery plugins layout 2use

  • I think you're mistaken about where the preloader will show up.

    Take a look at the demo page I put together:

    http://test.learningjquery.com/center.html

    click on a "center" button, and see where the div goes
  • // vertically center something in the viewport

    (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) ) {
    return window.innerHeight - (($
    (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
1 - 20 of 46 Next › Last »
Showing 20 items per page

Diigo is about better ways to research, share and collaborate on information. Learn more »

Join Diigo