• Resolved lyhtning

    (@lyhtning)


    Hi,

    Wondering if anyone knows how to get rid of the parallax effect? Do I have to delete something in the .js file? I have a Business Leader child theme already.

    Thanks in advance.

Viewing 5 replies - 1 through 5 (of 5 total)
  • If you want to get rid the parallax and also the image, you need to delete :
    bus_leader_get_header_container() in header.php

    If you want to keep the image and only get rid the parallax effect :

    • Go to style.css and change position of .header-container .header-image from fixed to absolute
    • Go to bus-leader-scripts.js and delete :
      $(window).scroll(function(e){
      		var scrolled = $(window).scrollTop();
      		$('.header-image').css('top', -(scrolled * 0.3) + 'px');
      	});
    • Don’t forget to load bus-leader-scripts.js instead of bus-leader-scripts.min.js
    Thread Starter lyhtning

    (@lyhtning)

    I made the appropriate changes to style.css and bus-leader-scripts.js

    But I think I’m having trouble with the last part, loading bus-leader-scripts.js I made a .js folder for my child theme, copying the parent theme folder paths and all, but I’m doing something wrong since I don’t see the .js folder or file when I go to Appearance, Editor?

    I tried looking up the issue elsewhere on wordpress and something about making a functions.php file? When I tried creating a functions.php file and went on Editor to see if it shows up properly, the entire screen is blank; removing the functions.php file from my child theme seems to fix that issue. (Not sure if this is relevant to the .js problem, but just to let you know.)

    Thanks!

    Apperance, Editor doesn’t have capability to edit the js files, it only let you edit css and php files, so don’t worry.

    Instead, just add script to load the js in your functions.php. Try this (It works for me) :

    function bus_leader_child_scripts() {
    	wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    
    	wp_enqueue_script( 'bus_leader-scripts', get_stylesheet_directory_uri() . '/js/bus-leader-scripts.js', array( 'jquery', 'masonry', 'bus_leader-enquire', 'bus_leader-superfish' ), '20141026', true );
    }
    add_action( 'wp_enqueue_scripts', 'bus_leader_child_scripts' );
    Thread Starter lyhtning

    (@lyhtning)

    I noticed that I had to add <?php before that script and it works perfectly.

    Thanks a lot for your help and prompt responses!

    Yeah, you must add <?php on top of functions.php.

    You’re welcome. ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Remove Parallax effect of header image’ is closed to new replies.