Piątek, 16 Styczeń
Imieniny: Mascelego, Walerii, Włodzimierza -

Reklama


Reklama



Piątek, 2026-01-16 17:55:12

  '); }, 500); }); function iframe_adv() { $('.iframe_adv_1920').each( function() { var w = $(this).width(); var h = w*360/1920; $(this).height(h); }); } function resizeCheck() { /* var h = $('header').outerHeight(); h = h + 10; $('body > .contents').css('padding-top', h); */ } function initAdvFixed(sel) { $(sel).find('div:first').attr('id', 'advBox'); $(sel).find('#advBox').find('div').each( function(i) { $(this) .addClass('adv') .attr('id', 'adv'+(i+1)) .css('width', '100%') .css('height', 'auto') .css('background', 'transparent') .css('margin-bottom', '10px') .css('text-align', 'center') .find('img') .css('width', 'inherit') ; }); var o = pobierzObiekt(sel); if(o === false) return false; var p = o.offset(); $(window).scroll( function() { var c1 = $('.blacksidebar').offset(); var c1 = c1.top + $('.blacksidebar').height(); var p = $(sel).offset(); p = p.top; var scr = $(this).scrollTop(); //var c2 = $(sel).find('#advBox > div:last').offset(); //c2 = c2.top + $(sel).find('#advBox > div:last').height(); var c2 = $(window).scrollTop() + $(sel).find('#advBox').outerHeight(); //console.log(c1+' !!! '+c2); if(c1 <= c2) { $(sel).find('#advBox') .removeAttr('style') .css('width', $('.blacksidebar').width() - 10) .parent() .css('position', 'absolute') .css('bottom', 0) .parent() .css('position', 'relative') .css('bottom', 'auto') ; } else if(p - scr <= 0) { $(sel).find('#advBox') .css('position', 'fixed') .css('top', 5) .css('width', $('.blacksidebar').width() - 10) .parent() .css('position', 'relative') .css('bottom', 'auto') ; } else { $(sel).find('#advBox').removeAttr('style').parent() .css('position', 'relative') .css('bottom', 'auto'); } //console.log(p+' !!! '+scr); }); } function pobierzObiekt(sel) { var w = $(window).height(); var last = $(sel).find('#advBox > div:last'); var nw = 0; var i = 0; while(last.hasClass('adv')) { nw += last.outerHeight(); if(nw > w && i == 0) return false; else if(nw > w) return last.next(); else last = last.prev(); i++; } return last; }