Getting Real, keine Post-Its und the end of the world as we know it (and I feel fine).
Getting Real, keine Post-Its und the end of the world as we know it (and I feel fine).
jQuery:
$(document).ready(function() {
// check where the shoppingcart-div is
var offset = $('#shopping-cart').offset();
$(window).scroll(function () {
var scrollTop = $(window).scrollTop();
// check the visible top of the browser
if (offset.top<scrollTop) {
$('#shopping-cart').addClass('fixed');
} else {
$('#shopping-cart').removeClass('fixed');
}
});
});
CSS:
.fixed {
position: fixed;
top: 20px;
margin-left: 720px;
background-color: #0f0 ! important;
}
Habe vor ca. 2 Jahren mal aus Spaß ein paar Renderings vom iPad bzw. MacTouch, wie ich es mir damals vorgestellt habe, gemacht. Damals noch mit Chrom anstatt mattem Alu und so dick wie Laptops damals nunmal waren, aber irgendwie gar nicht so weit vom heute vorgestellten iPad weg. Natürlich damals noch mit Leopard und nicht mit iPhone OS 4.