| FAQ |
| Kalender |
|
|
#2 | ||
|
|||
|
Klarade millennium-buggen
|
Ska den inte följa med?
#secondary får även klassen "fixed" när användaren skrollat ner. Detta styrs med hjälp av något javascript. du har följande skript i vemringde-0.1b.js: Kod:
// fixed sidebar
// http://jqueryfordesigners.com/fixed-floating-elements/
var top = $('#secondary').offset().top;
var left = Math.ceil($('#secondary').offset().left);
$(window).scroll(function (event) {
// what the y position of the scroll is
var y = $(this).scrollTop() +92;
// whether that's below the form
if (y >= top) {
// if so, ad the fixed class
$('#secondary').addClass('fixed');
} else {
// otherwise remove it
$('#secondary').removeClass('fixed');
}
});
Senast redigerad av allstars den 2010-10-29 klockan 10:03 |
||
|
|
Svara med citat
|
|
|