Home › Forums › WordPress Themes – Premium › Circumference › Page Jumps with Sticky Menu
- This topic has 19 replies, 34 voices, and was last updated 7 years, 3 months ago by
Sushil Adhikari.
-
AuthorPosts
-
February 17, 2016 at 8:01 pm #22467
Sushil Adhikari
ModeratorHi 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
February 17, 2016 at 8:11 pm #22468Francois Zietsman
ParticipantHi 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
February 17, 2016 at 8:15 pm #22469Francois Zietsman
ParticipantI again added it to the fuctions.php file and the site is working, but still jumps when the sticky menu is activated.
Thanks
February 17, 2016 at 8:25 pm #22470Sushil Adhikari
ModeratorSorry 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
February 18, 2016 at 7:49 am #17060Sushil Adhikari
ModeratorHi 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
-
AuthorPosts
- You must be logged in to reply to this topic.