var tpbl = $(this).prev().prev().prev().prev('blocks');
$("blocks").each(function(){
if (tpbl.length)
{
var top = tpbl.css('top');
var hei = tpbl.children('scrl').height() - 295 + parseFloat(top);
$(this).css('top', hei);
}
});
var tpbl = $(this).prev().prev().prev().prev('blocks');
console.log(1,tpbl,tpbl.length)
$("blocks").each(function(){
var tpbl = $(this).prev().prev().prev().prev('blocks');
console.log(2,tpbl,tpbl.length)
if (tpbl.length)
{
var top = tpbl.css('top');
var hei = tpbl.children('scrl').height() - 295 + parseFloat(top);
$(this).css('top', hei);
}
});
var tpbl = $(this).prev().prev().prev().prev('blocks'); var count=0;
switch(true)
{
case (wih > 1920): count = 5;break;
case (wih > 1440): count = 4;break;
case (wih > 1024): count = 3;break;
case (wih > 640): count = 2;break;
default: count = 1;
}
var bloks=$('conteiner block');
for(i = 0; i< bloks.length;i++){
if (i>count){
var tpbl=bloks[i-count];
var top = tpbl.css('top'),
hei = tpbl.children('scrl').height() - 295 + parseFloat(top);
bloks[i].css('top', hei);
}
}