• I’m using a new header for my website, but when I scroll down, the header image scrolls down too. I’d really like for it to be fixed so that it doesn’t move while I scroll down. What do I need to do?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Sam – Unsheathed

    (@sam-unsheathed)

    Can anyone help me? I’m still having this problem.

    Hi Sam,

    That’s the parallax effect, but you could completely remove the effect by deleting the following code from the custom.js file:

    /* Parallax ---------------------*/
    function parallaxSetup() {
    	var $window = $(window);
    	$('#custom-header[data-type="background"]').each(function(){
    		var $bgobj = $(this); // assigning the object
    		$(window).scroll(function() {
    			var yPos = -($window.scrollTop() / $bgobj.data('speed'));
    			// Put together our final background position
    			var coords = '50% '+ yPos + 'px';
    			// Move the background
    			$bgobj.css({ backgroundPosition: coords });
    		});
    	});
    }

    And this:

    .ready( parallaxSetup )

    Hope that helps!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Header Image Scrolling’ is closed to new replies.