Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #978703
    markspikerussell
    Participant

    Hi,

    I have the following js and html in a raw block on my page here http://109.169.59.51/~focusfit/yoga-ashtanga-style/

    <script src=”https://code.jquery.com/jquery-1.10.2.js”></script&gt;
    <button class=”show-contact shade my-flex”>[x_icon type=”comments-o”]</button>
    <script>
    $( “button” ).click(function() {
    $( “.contact-btn-raw” ).toggle( “slow” );
    });
    </script>

    The script is working well, but this seems to have stopped the dropdown in the menu bar from working, and has changed the header type from fixed to static. Its only affecting this page. Is there any help you could provide?

    I’m just trying to toggle on/off the class .contact-btn-raw

    All WP, X, CS and other plugins up to date.
    Server running on PHP7.
    No caching or minification enabled yet

    Thanks

    #979421
    Darshana
    Moderator

    Hi there,

    Thanks for writing in! Could you please try disabling the timetable plugin that you have as I see console error with related to that plugin.

    Let us know how it goes.
    Thanks!

    #979986
    markspikerussell
    Participant

    Hi, I sure can, although that timetable plugin is activated on all the other pages with no affect to those pages.

    Will report back.

    #979990
    markspikerussell
    Participant

    Hi, Timetable plugin disabled and is made no affect.

    The timetable shortcode is in modal pop-ups on almost every page with no adverse affects.

    The only page that is affected is the one with the script above.

    Any ideas?
    Thanks

    #980076
    Christopher
    Moderator

    Hi there,

    Please add following code in Customize -> Custom -> JavaScript :

    jQuery(document).ready(function($){
    	$(window).scroll(function(){
    		if ($(this).scrollTop() > 10) {
    			$('.page-id-17 .x-navbar').addClass("x-navbar-fixed-top");
    		} else {
    			$('.page-id-17 .x-navbar').removeClass("x-navbar-fixed-top");
    		}
    	});
    });

    Please add following code in Customize -> Custom -> CSS :

    .page-id-17 li.menu-item-has-children:hover ul {
        display: block;
    }

    Hope it helps.

    #980854
    markspikerussell
    Participant

    Hi Guys, that worked great!

    So now that page works better that the others, when you hover over the ‘Classes & Clubs’ menu item the megamenu drops down without having to click.

    Will I have to add the same for each page, or can I call them all in one CSS and one jQuery?

    Thanks

    #980887
    Nabeel A
    Moderator

    Hi again,

    To make it generic, you can replace the previous code with this one:

    jQuery(document).ready(function($){
    	$(window).scroll(function(){
    		if ($(this).scrollTop() > 10) {
    			$('.x-navbar').addClass("x-navbar-fixed-top");
    		} else {
    			$('.x-navbar').removeClass("x-navbar-fixed-top");
    		}
    	});
    });

    And CSS will be:

    li.menu-item-has-children:hover ul {
        display: block;
    }

    Hope this help!

  • <script> jQuery(function($){ $("#no-reply-978703 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>