Jump to content

Fixed Header


Recommended Posts

Good on design issues I'm green, so I am writing to see if I echais us a hand;)

Well the question is this, is I want to make this template http://pavodemo.com/prestabrain/nextstore/hitech/index.php

a float fixed header or header is not exactly as stated. But it also includes the cart in it, down the page down.

 

To always stay as the menu at the top of the page. Type what makes now also the page of this forum prestashop, lowering the header stays up top ...

 

Thanks in advance. I hope for your wonderful help.

 

Regards

post-368162-0-08030500-1426541290_thumb.png

Edited by JavierP (see edit history)
Link to comment
Share on other sites

use this js snippet:
 

$(window).scroll(function(){
      if ($(this).scrollTop() > 135) {
          $('#pts-mainnav').addClass('fixed');
      } else {
          $('#pts-mainnav').removeClass('fixed');
      }
  });

and in css styles define class "fixed"

 

.fixed {
position:fixed!important;
z-index:9999;
width:100%;
margin:0px;
top:0px;
}

it will work in that way then:
  • Like 2
Link to comment
Share on other sites

 

use this js snippet:

 

$(window).scroll(function(){
      if ($(this).scrollTop() > 135) {
          $('#pts-mainnav').addClass('fixed');
      } else {
          $('#pts-mainnav').removeClass('fixed');
      }
  });

and in css styles define class "fixed"

 

.fixed {
position:fixed!important;
z-index:9999;
width:100%;
margin:0px;
top:0px;
}

 

it will work in that way then:

 

$(window).scroll(function(){

if ($(this).scrollTop() > 135) {

$('#pts-mainnav').addClass('fixed');

} else {

$('#pts-mainnav').removeClass('fixed');

}

});

 

where paste ?

Link to comment
Share on other sites

 

use this js snippet:

 

$(window).scroll(function(){
      if ($(this).scrollTop() > 135) {
          $('#pts-mainnav').addClass('fixed');
      } else {
          $('#pts-mainnav').removeClass('fixed');
      }
  });

and in css styles define class "fixed"

 

.fixed {
position:fixed!important;
z-index:9999;
width:100%;
margin:0px;
top:0px;
}

 

it will work in that way then:

 

where they made these changes ?

Link to comment
Share on other sites

  • 3 months later...
  • 3 weeks later...
  • 3 months later...

Great tutorial, is working, but depends your  div header to mine is

that in global.js

 

$(window).scroll(function(){
      if ($(this).scrollTop() > 150) {
          $('#header').addClass('fixed');
      } else {
          $('#header').removeClass('fixed');
      }
  });

 

 

this chunk in global.css

 .fixed {
position:fixed!important;
z-index:9999;
width:100%;
margin:0px;
top:0px;
}

Link to comment
Share on other sites

  • 6 months later...

 

Hi. 
I used this snippet for "block_top_menu". Works great, but when, while scrolling, "block_top_menu" become "fixed" it changes width on 1263px (from 1170px). How to fix this issue?    

 

 

any chance to inspect it directly on your website, please?

Link to comment
Share on other sites

  • 3 years later...
On 3/17/2015 at 5:15 PM, vekia said:

use this js snippet:
 


$(window).scroll(function(){
      if ($(this).scrollTop() > 135) {
          $('#pts-mainnav').addClass('fixed');
      } else {
          $('#pts-mainnav').removeClass('fixed');
      }
  });

and in css styles define class "fixed"

 

.fixed {
position:fixed!important;
z-index:9999;
width:100%;
margin:0px;
top:0px;
}

it will work in that way then:

thank you for this solution

when you are using classic theme modify 

theme.js

and theme.css

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...