See this image
In this website i need to make header sticky Is there any way to make that sticky. I had tried this code. but header layer goes behind the all page content and not working properly even navigation button not clickable. please help me.thanks in advance.
.site-header-style-2 #header {
padding: 0;
position: fixed;
width: 100%;
top: 0;
}
Related
I have a store https://firefits-com.myshopify.com and Fashe colorlib theme is installed.
Issue
The product name is clickable and redirects me to the product detail page but the images are unclickable and do nothing when i hove mouse to it.
What I want
I want the product images that clickable and redirect me to product page as the product name do.
I have searched a lot on Shopify forums, their e-commerce university and theme help but none of them help me.
Your CSS is making things difficult. The grey overlay is in front of the go to page link wrapping the image so the link is unclickable.
Adding something like this your assets/custom.css stylesheet starts to address the issue but you have a bunch more things to do so that the overlay functions the way you want it to.
.block2-img.wrap-pic-w {
width: 100%;
height: 0;
padding-top: 133%;
}
.block2-img a {
position: absolute;
display: block;
width: 100%;
height: 100%;
top: 0;
left: 0;
background-color: transparent;
margin: 0;
}
I would like to make the Jssor Carousel full width, without resizing height at all when the window resizes. So on a wide screen, it would show more slides and on a narrow screen it will show less, without ever changing height. I don't want the slider to resize, I just want it to cut off, if that makes sense.
So far I've got it working as I'd like in Firefox, Chrome, Safari and Opera. If I'm not explaining it very well, I apologize, you can see an example of how I'd like it to work here: http://jessetessman.com/110/slider.php in Firefox, Chrome, Safari or Opera. Note, when you resize the window you have to refresh to resize the slider.
My problem is, it doesn't work in IE. It just has a width of 100px in IE and I have no idea how to get it working.
I appreciate any help you can give. I realize the way I have it now is probably not the best way to go about accomplishing this, but I am not very good with javascript so I just messed with it until I got to this point. Any suggestions about better ways to do this are certainly welcome.
Thank you in advance for the help.
Please add one line $("#news-slider").width("100%");
var jssor_slider1 = new $JssorSlider$("news-slider", options);
$("#news-slider").width("100%");
Forgot to change following css, make the width to greater than screen width then.
#news-slider {
left: 0px; top: 0px; width: 2400px; height: 350px; overflow: hidden; position: relative;
}
#news-slider .slides {
left: 0px; top: 0px; width: 2400px; height: 350px; overflow: hidden; z-index: 0;
}
I have a client that wants a header like on this site http://www.solewood.com/
I have found a few questions here but they are geared only for a certain element of the header. Here is the site I am working on http://treestyle.com/ The password is vewghu
They are both shopify sites. Any help would be greatly appreciated.
If you inspect the solewoood website you can get an idea of how they've implemented the header.
When the page is at the top, there is this CSS for the header div:
<div class="header">
.header {
position: fixed;
transition: all 500ms ease 0s;
width: 100%;
z-index: 1000;
}
And when you scroll down, the .header_bar CSS class is added to the div as well:
<div class="header header_bar">
.header_bar {
background-color: #FFFFFF;
border-bottom: 1px solid #E5E5E5;
}
.header {
position: fixed;
transition: all 500ms ease 0s;
width: 100%;
z-index: 1000;
}
There are a few other things that are also changed when the user scrolls down from the top (logo, text colour, etc.), but you get the idea.
If you are unsure how to detect if the user is at the top of the page, see here.
EDIT:
In response to your comment, try using jQuery's .toggleClass() with 2 parameters.
For example:
$(window).scroll(function(e){
$el = $('.header');
$el.toggleClass('header_bar', $(this).scrollTop() > 0);
});
This shows it quite nicely: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_shrink_header_scroll
I used this technique to turn the background-color to white on scroll, then back to transparent when back at top.
And if you wanted to completely swap out headers. You could duplicate the headers, then use this to turn display on and off for those.
The header works fine in all browsers and on all pages EXCEPT for the blog pages in safari. On these pages the header disappears when you scroll down the page and then reappears at the bottom. The links in the header can still be clicked on when it is hidden though.
I've tried playing around the z-index but with no luck
#header{ padding: 31px 0 0;
position:fixed;
overflow: hidden;
width: 100%;
z-index:10000;
top: 0;
left: 0;
opacity: .95;
}
#precontent {
overflow:hidden;
padding-top:100px;
}
}
Homepage - with no issues
http://bit.ly/HTACng
Blog - page with disappearing/reappearing header on scroll down
http://bit.ly/12kq6MM
Any assistance would be greatly appreciated as I'm really stuck on why this is only occurring in safari.
I want to create a sticky header bar for a website just like the sticky header on this website (http://www.fizzysoftware.com/) if any on can can help me out with coding or any resource that helps me to create the same. Your reply would be of great help to me.
In your CSS, add
position: fixed;
to your header element. It's just that simple, really.
And next time, try to use right click on something you see on website and choose "Inspect element". I think that every modern browser has it now. Very useful function.
If you want to make it sticky when it's scroll down to a certain point then you can use this function:
$window = $(window);
$window.scroll(function() {
$scroll_position = $window.scrollTop();
if ($scroll_position > 300) { // if body is scrolled down by 300 pixels
$('.your-header').addClass('sticky');
// to get rid of jerk
header_height = $('.your-header').innerHeight();
$('body').css('padding-top' , header_height);
} else {
$('body').css('padding-top' , '0');
$('.your-header').removeClass('sticky');
}
});
And sticky class:
.sticky {
position: fixed;
z-index: 9999;
width: 100%;
}
You can use this plugin and it has some useful options
jQuery Sticky Header
CSS already gives you the answer. Try this out
.sticky {
position: -webkit-sticky;
position: sticky;
top: 0;
}
now add the class sticky to any menu sidebar or anything you want to stick to the top and it will automatically calculate the margin and stick to the top. Cheers.
If you want simplicity in a HTML and CSS option to create a Stiky NavBar you can use the following:
Just create a navbar like this one:
<nav class="zone blue sticky">
<ul class="main-nav">
<li>About</li>
<li>Products</li>
<li>Our Team</li>
<li class="push">Contact</li>
</ul>
</nav>
Remember to add the classes in this case I created a Zone (to separate my HTML in specific areas I want my CSS to be applied) blue (just a color for the nav) and sticky which is the one that gonna carry our sticky function. You can work on other attributes you want to add is up to you.
On the CSS add the following to create the sticky; first I am gonna start with the zone tag
.zone {
/*padding:30px 50px;*/
cursor:pointer;
color:#FFF;
font-size:2em;
border-radius:4px;
border:1px solid #bbb;
transition: all 0.3s linear;
}
now with the sticky tag
.sticky {
position: fixed;
top: 0;
width: 100%;
}
Position fixed meaning it will always be in the same position; and with top 0 I will always be at the top and a 100% width so it covers the whole screen.
And now the color to make our navbar blue
.blue {
background: #7abcff;
You can use this example to create a sticky navbar of yours and play around with the CSS properties to customize it to your liking.
Try This
Add this style to the corresponding
style="position: fixed; width: -webkit-fill-available"
OR
<style>
.className{
position: fixed;
width: -webkit-fill-available;
}
</style>