• Hi, I am running into a problem with the width setting in the class=”.sticky-element-placeholder .sticky-element-active” inline style, and I cannot find where or how to adjust this setting in my .css for Sticky Menu, and my css override attempts have failed.

    I want to change the this so that the menu bar snaps to the correct width of the rest of the page, and eliminates the x-scroll bar on the bottom. I have tried several different css modifications to try and override this setting, but have had no luck. When I change this setting to “auto” using Chrome developers tools, it displays correctly.

    Specific code in question:
    <div class=”sticky-element-placeholder sticky-element-active” style=”display:block; float:none; flex:0 1 auto; box-sizing:border-box; clear:none; overflow:visible; width:1007px; height:82px; margin:0px 0px 0px 0px;”></div>

    Thank you for your help!

    https://www.ads-software.com/plugins/sticky-menu-or-anything-on-scroll/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi! I’m having a bit of trouble understanding why the width needs to be “auto” and why 1007 wouldn’t work (isn’t that the width of the original element?). It may be a bug in my plugin though.

    Is there a way you can share a link to your site so I can see the issue? It would also help to turn on the Debug Mode in the plugin settings, which will make it easier for me to diagnose.

    Thread Starter designerpat

    (@designerpat)

    It also works if I change the width to 100% in developer tools.

    The site is five04media.com. I turned on Debug. Thanks for looking Mark.

    Thanks for the link!

    So, a few things….. When you disable the plugin, is there already a horizontal scrollbar at the bottom of the page? I tried to debug a bit and it looks like there is, and that’s due to this line:

    .main-navigation {
        margin: 0 -0.875em;
    }

    I believe the best way to fix this, is by adding “overflow:hidden” to “#masthead”.

    So that’s something that’s not directly related to the plugin, but I believe that if you change that , the scrollbar should be gone. Can you give that a try and see if that solves the issue?

    I don’t see anything else that’s going wrong though — the menu bar seems to have the same width in sticky mode and in non-sticky mode.

    However, having said that, you might not even need the plugin in the first place. It seems your menu bar is *always* sticky, and not just on scrolling. So, you might be set already if you just add “position:fixed” to “#masthead” and not use the plugin.

    (You’d still have to fix the scrollbar issue though, see above.)

    Thread Starter designerpat

    (@designerpat)

    First I turned off the plugin, and yea it still had the scrollbar at the bottom. So I added overflow:hidden to the #masthead and that squashed the scrollbar at the bottom. However, my nav bar doesn’t stick without the plugin, and when I turn the plugin back on, the bottom scrollbar comes back.

    Ive got the plugin off right now to show that the scroll is gone and that my menu doesn’t stick.

    Exactly, that’s what I meant with the second part of my previous post: if you also add “position:fixed” to “#masthead”, it will be always be sticky without the use of a plugin, which is what you probably want.

    However, then the menu it will then overlap your content. To solve that, there would be more work involved.

    [ORIGINAL CONTENT DELETED — see below.)

    Forget everythng I said! I’ve figured out the issue and I’ll be implementing the fix today, but I just need to test it a bit with other situations. Tomorrow or Tuesday I will release v2.0.1 with this fix, so it should update automatically by then.

    Thanks for reporting this! ??

    Thread Starter designerpat

    (@designerpat)

    Thank you too for all your help!

    I’ve implemented a fix in the new version of the plugin that should solve this issue. The new version is not publicly available yet but you can download it, install and see if it resolves the problem for you.

    1. download the plugin from https://bitbucket.org/senff/sticky-menu-or-anything-wp/get/master.zip
    2. unzip the file to your hard drive
    3. copy all of its contents to /wp-content/plugins/sticky-menu-or-anything (overriding all existing files in that directory, if you already had it installed before)
    4. go into your plugin settings
    5. go to the Advanced tab
    6. make sure “Legacy Mode” is NOT checked

    Please try it and let me know if it works.

    Thanks!

    delete please

    Update: version 2.0.1 is now available in the www.ads-software.com repo and you should be notified of the update on the plugins page of the admin section of your site.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Changing width of Sticky element’ is closed to new replies.