Il y a 1 margin-top de 20px mais si on est sur un petit écran la bannière vient se mettre dans le footer. Pas très joli.
Voici le code JS $(function () {
var msie6 = $.browser == 'msie' && $.browser.version < 7;
if (!msie6) { var top = $('#sidebar').offset().top - parseFloat($('#sidebar').css('margin-top').replace(/auto/, 0)); $(window).scroll(function (event) { // what the y position of the scroll is var y = $(this).scrollTop();
// whether that's below the form if (y >= top) { // if so, ad the fixed class $('#sidebar').addClass('fixed'); } else { // otherwise remove it $('#sidebar').removeClass('fixed'); } }); } });
ET le CSS #sidebar.fixed{ position: fixed; top:0; margin-top:20px; } #sidebar{ z-index:5; position:absolute; top:1180px; }
Que dois-je faire pour que l'image reste au dessus du footer donc il faudrait un margin-bottom de 300 px.
Merci de votre aide, je veux bien vous payer si vous savez m'aider.
Infographiste Webdesigner Design Prestashop (Ecommerce) | Création site internet | Création site de vente en ligne | Graphisme et création de logos E-mail: info@ldesign.be skype: ldesign.webdesigner www.ldesign.be
Re:bannière fixe qui suit scrollbar
« Répondre #1 sur: le 26-07-2013 a 10:48:08 »