• Resolved pako69

    (@pako69)


    I just discover your plugin while I was searching to replace Ninja Quick Sliding Panel ??

    I would like to know how I can add the class ‘sidebar’ to your DIV #mojo-sp-left-wrap without put my hand into your code.

    I know that WordPress as a lot of functions and maybe there is one that can hook your <div id=”mojo-sp-left-wrap”> to become
    <div id="mojo-sp-left-wrap" class = "sidebar">
    when the panel is closed, and
    <div id="mojo-sp-left-wrap" class = "sidebar mojosp-panel-visible">
    when the panel is open

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author More Karvonen

    (@qumos)

    Hi Pako!
    I don’t know any ready-made functions in WordPress that could handle what you want.

    Howerver, adding a small piece of code anywhere in you theme (e.g. footer.php) *should* do the trick:

    <script>
    ( function( $ ) {
      $( document ).ready(function() {
    	$("#mojo-sp-left-wrap").addClass("sidebar");
        }
      });
    } )( jQuery );
    </script>

    Since my plugin is using standard jQuery toggleClass, addClass and removeClass functions, you should be fine adding your own class to the div and it remains untouched.

    I have NOT tested this code, but feel free to try it out and let me know if it did the trick.

    cheers – More

    Thread Starter pako69

    (@pako69)

    Hi @qumos

    My shame… didn’t think about this simple jQuery code!
    I just had a test before, like:

    if($("#mojo-sp-left-wrap").length) {
    	$("#mojo-sp-left-wrap").addClass("sidebar");
    }

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add a class to #mojo-sp-left-wrap ?’ is closed to new replies.