Home Forums Fusion Adding Background Color to fixed menu

This topic contains 4 replies, has 2 voices, and was last updated by  WordpressDev 3 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #47765

    WordpressDev
    Participant

    Hi!

    First, thank you for this great theme. I have really enjoyed working with it so far.

    I am having an issue with setting a background color to a fixed menu as users scrolldown the page.

    I tried using this code that you provided in another thread (below) but was not able to get it to work. Have any ideas to fix this? Thank you!

    jQuery(document).ready(function($){
    var scroll_start = 0;
    var offset = 500;
    $(document).scroll(function() {
    scroll_start = $(this).scrollTop();
    if(scroll_start > offset.top) {
    $(“.navbar”).css(‘background-color’, ‘#f0f0f0′);
    } else {
    $(‘.navbar’).css(‘background-color’, ‘transparent’);
    }
    });
    });

    #47769

    Joshua
    Keymaster

    Could you post a link to your site with this code added in so I can check for you?

    #47771

    WordpressDev
    Participant
    This reply has been marked as private.
    #47773

    Joshua
    Keymaster

    I’m seeing the code you posted there show up (there may be server side caching which is why you weren’t able to see it).

    To get it working, you can change that first line from:

    $(document).ready(function(){

    To this:

    jQuery(document).ready(function($){

    #47775

    WordpressDev
    Participant

    This worked like a charm, thank you!!!

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.