#logo {
position: absolute;
width: 40px;
height: 40px;
left: 0;
top: 0;
padding: 4px;
}
var margin = 15; // 15px отступ для наглядности
$('.container').on('resize scroll', function() {
var $container = $(this);
var container_height = $container.outerHeight();
$('.block').each(function(i, block) {
var $block = $(block);
var top = $block.offset().top - $container.offset().top;
var bottom = top + $block.outerHeight();
var is_visible = (bottom > (0 + margin) && top < (container_height - margin));
$block[is_visible ? 'addClass' : 'removeClass']('block-visible');
});
}).trigger('scroll');
.block-visible { background-color: red; }
$('#modal-iframe').on('show.bs.modal', function(e) {
var button = $(e.relatedTarget);
var allowFullscreen = button.data('bmdVideoFullscreen') || false;
var dataVideo = {
src: button.data('bmdSrc'),
height: button.data('bmdHeight') || 100,
width: button.data('bmdWidth') || 500
};
if ( allowFullscreen ) dataVideo.allowfullscreen = "";
// stampiamo i nostri dati nell'iframe
$(this).find("iframe").attr(dataVideo);
}).on('hidden.bs.modal', function(){
$(this).find('iframe').html("").attr("src", "");
});
@-webkit-keyframes z_mob_phone_anim {
...
}
div { display: inline-block; }
<div class="grid-1">
1
</div><div class="grid-6">
6
</div>
</div><div class="grid-11">
11
</div>
div { display: table; }
div ul { display: table-row; }
div ul li { display: table-cell; }
<div>
<ul>
<li class="grid-1">
1
</li>
<li class="grid-6">
6
</li>
<li class="grid-11">
11
</li>
</ul>
</div>
var isTouch = ('ontouchstart' in window || (window.DocumentTouch && document instanceof DocumentTouch)) ? true : false,
pushstart = isTouch ? "touchstart" : "mousedown",
pushend = isTouch ? "touchend" : "mouseup";
$(".content").click(function(e){ ... }
$(".content").bind(pushend, function(e){ ... }