Make your domain name count

Out of context: Reply #28

  • Started
  • Last post
  • 28 Responses
  • lowimpakt0

    </script><script type="text/javascript" charset="utf-8">
    var viewport_height, body_height, content_height, alley_height, header_height, footer_height;
    function reset_offsets() {
    viewport_height = jQuery(window).height();
    body_height = jQuery('body:first').height();
    content_height = jQuery('#content').height();
    footer_height = jQuery('#footer').height();
    alley_height = jQuery('#public_voice').height...
    header_height = jQuery('#header').height() + 15; // hmm, hacky...
    set_alley_position();
    };

    if (qbn.cookie('pv_lock') === null) {
    qbn.cookie('pv_lock', 'false', qbn.globals.cookieProps);
    }

    // safari 2 hack
    if (qbn.globals.safari) {
    qbn.cookie('pv_lock', 'true', qbn.globals.cookieProps);
    }

    function toggle_lock() {
    var nstate = 'true';
    if (qbn.cookie('pv_lock') == 'true') {
    nstate = 'false';
    }
    qbn.cookie('pv_lock', nstate, qbn.globals.cookieProps);
    set_lock_text();
    set_alley_position();
    };
    function set_lock_text() {

    // safari 2 hack
    if (qbn.globals.safari) {
    jQuery('#alley-lock').html('');
    return;
    }

    if (qbn.cookie('pv_lock') == 'false') {
    jQuery('#alley-lock').html('Stay...
    return;
    }
    jQuery('#alley-lock').html('Foll...
    };

    set_lock_text();
    reset_offsets();
    jQuery(window).resize(reset_offs...

    function reset_alley() {
    jQuery('#topics').css({
    'position': '',
    'marginTop': '',
    'bottom': ''
    });
    };

    function set_alley_position() {
    if (qbn.cookie('pv_lock') == 'true') {
    reset_alley();
    return;
    }

    if (viewport_height < alley_height) {
    reset_alley();
    return;
    }

    var topics = jQuery('#topics');
    var window_offset = document.documentElement.scrollTop || document.body.scrollTop;

    if (window_offset < header_height) {
    reset_alley();
    return;
    }

    // 14*2 is footer margin, hacky
    if (window_offset < (body_height - footer_height - alley_height - 14*2)) {
    if (qbn.globals.ie) {
    topics.css({'marginTop': (window_offset - header_height) + 'px'});
    } else {
    topics.css({
    'position': 'fixed',
    'top': '5px',
    'marginTop': ''});
    }
    return;
    }

    topics.css({
    'marginTop': (content_height - alley_height) + 'px',
    'position': '',
    'top': ''});
    };

    var waiting_timer = null;

    jQuery(document).ready(reset_offsets);
    jQuery(window).load(reset_offsets);

    // to keep things consistent while page elements are loading
    jQuery(document).ready(function() {waiting_timer = window.setInterval(reset_offsets, 500);});
    jQuery(window).load(function() {window.clearInterval(waiting_timer);});

    jQuery(window).scroll(set_alley_position);
    </script>

View thread