Home Forums WordPress Themes – Premium Circumference Page Jumps with Sticky Menu

Viewing 5 posts - 16 through 20 (of 20 total)
  • Author
    Posts
  • #22467
    Sushil Adhikari
    Moderator

    Hi there,

    Please try this code on functions.php file , it may works for sticky menu

    
    //remove celestial theme customize function of parent
    add_action('after_setup_theme', 'circumference_child_remove_sticky_action');
    
    function circumference_child_remove_sticky_action() {
    	remove_action('wp_head', 'celestial_theme_customize_js');
    }
    
    //add sticky menu with offset value 10
    add_action('wp_head', 'circumference_child_add_Sticky');
    function circumference_child_add_Sticky() {
    	?>
    
    	(function ( $ ) {
    		$(document).ready(function(){
    			var active = "";
                if (active == 1) {
                	$(window).scroll(function() {
                		var scrollTop = $(window).scrollTop();
                		if (scrollTop > 10) {
                			$('#logo img').css({"width":"50%"});
                			$("#cir-site-header").css({"position":"fixed", "right":"0px", "left":"0px", "top": "0px","z-index":"1080","padding": "5px 0px 0px 0px", 'box-shadow': '0.5px 0.5px 0.5px #EAEAEA'});
                			$("#site-navigation").css({"margin":"10px 0"});
    					}
    					else {
    						$('#logo img').css({"width":"100%"});
    						$("#cir-site-header").css({"position":"relative", 'box-shadow':'none', "padding": "2em 0"});
    				    }
      				});
                }
    		});
    })(jQuery);
    
    <?php
    }

    Let us know how it will goes.

    We are looking forward for your response.

    Thanks

    #22468
    Francois Zietsman
    Participant

    Hi Sushil

    Thanks, I added it in the functions.php of the Circumference Child theme but then I get a 500 Server error.

    I had to upload the original again via ftp to get the site working again.

    Regards

    Francois

    #22469
    Francois Zietsman
    Participant

    I again added it to the fuctions.php file and the site is working, but still jumps when the sticky menu is activated.

    Thanks

    #22470
    Sushil Adhikari
    Moderator

    Sorry Francois Zietsman, this issue is really frustrating for both of us, so could you please try again by providing minimum offset of 1, here is the code for it.
    Remove the previous one and add this code.

    
    //remove celestial theme customize function of parent
    add_action('after_setup_theme', 'circumference_child_remove_sticky_action');
    
    function circumference_child_remove_sticky_action() {
    	remove_action('wp_head', 'celestial_theme_customize_js');
    }
    
    //add sticky menu with offset value 10
    add_action('wp_head', 'circumference_child_add_Sticky');
    function circumference_child_add_Sticky() {
    	?>
    
    	(function ( $ ) {
    		$(document).ready(function(){
    			var active = "";
                if (active == 1) {
                	$(window).scroll(function() {
                		var scrollTop = $(window).scrollTop();
                		if (scrollTop > 1) {
                			$('#logo img').css({"width":"50%"});
                			$("#cir-site-header").css({"position":"fixed", "right":"0px", "left":"0px", "top": "0px","z-index":"1080","padding": "3px 0px 0px 0px", 'box-shadow': '0.5px 0.5px 0.5px #EAEAEA'});
                			$("#site-navigation").css({"margin":"10px 0"});
    					}
    					else {
    						$('#logo img').css({"width":"100%"});
    						$("#cir-site-header").css({"position":"relative", 'box-shadow':'none', "padding": "2em 0"});
    				    }
      				});
                }
    		});
    })(jQuery);
    
    <?php
    }

    Have patience Francois, we are trying our level best to fixed your issue, please be online at our live support so that it will be easy for both of us to solve issue

    Thanks

    #17060
    Sushil Adhikari
    Moderator

    Hi there,

    Please remove all code that is given on previous thread

    //remove celestial theme customize function of parent
    add_action('after_setup_theme', 'circumference_child_remove_sticky_action');
    function circumference_child_remove_sticky_action() {
    	remove_action('wp_head', 'celestial_theme_customize_js');
    }
    //add sticky menu with offset value 100
    add_action('wp_head', 'circumference_child_add_Sticky');
    function circumference_child_add_Sticky() {
    	?>
    
    	(function ( $ ) {
    		$(document).ready(function(){
    			var active = "";
                if (active == 1) {
                	$(window).scroll(function() {
    
                		var scrollTop = $(window).scrollTop();
                		var window_height = $( window ).height();
                		var content_height = $('#cir-wrapper').height();
                		var sticky_menu_height = $('header#cir-site-header').height();
                		if (scrollTop > 100 ) {
    	            		if ( (parseInt(content_height) ) > (parseInt(window_height) + parseInt(200) + parseInt(sticky_menu_height) ) ) {
    	            			$('#logo img').css({"width":"50%"});
    	            			$("#cir-site-header").css({"position":"fixed", "right":"0px", "left":"0px", "top": "0px","z-index":"1080","padding": "5px 0px 0px 0px", 'box-shadow': '0.5px 0.5px 0.5px #EAEAEA'});
    	            			$("#site-navigation").css({"margin":"10px 0"});
    	            		} 
                		} else {
    						$('#logo img').css({"width":"100%"});
    						$("#cir-site-header").css({"position":"relative", 'box-shadow':'none', "padding": "2em 0"});
    				    }	
    				});
    			}	
    		});
    })(jQuery);
    
    <?php
    }

    Note: Please be online at our live chat while preceding this process.

    Thanks

Viewing 5 posts - 16 through 20 (of 20 total)
  • You must be logged in to reply to this topic.