• Resolved Alagi

    (@alagi)


    I’ve tried some plugins for this purpose, without luck. Any help or if you can suggest or recommend any plugin, will be welcome.

    Here is some plugins I found on google, but they didn’t work for me.

    Q2W3 Fixed Widget
    Standard Widget Extensions
    Strx Magic Floating Sidebar Maker

    Thanks in advance!.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Richie KS

    (@rkcorp)

    this is a customization question, the theme did not have sticky sidebar features. i usually consult this with our donater or supporter only. but i’ll make an exception since its near xmas..hehe..ok..add this in your functions.php or wp-content/meso-custom-functions.php, might need couple of adjustment for the .itfixed css

    <?php
    function meso_add_sticky_sidebar() { ?>
    <script type="text/javascript">
    jQuery.noConflict();
    jQuery(document).ready(function(){
    var $sd = jQuery;
    // grab the initial top offset of the sidebar
    var side_offset_top = $sd('#right-sidebar').offset().top;
    // our function that decides weather the sidebar bar should have "fixed" css position or not.
    var side_navigation = function(){
    var scroll_top = $sd(window).scrollTop();
    
    if (scroll_top >= $sd('#right-sidebar').offset().top + $sd('#right-sidebar').outerHeight() - window.innerHeight ) {
    
    $sd('#right-sidebar').addClass('itfixed');
    
    } else {
    
    $sd('#right-sidebar').removeClass('itfixed');
    
    }};
    
    // run our function on load
    side_navigation();
    $sd(window).scroll(function() {
    side_navigation();
    });
    
    });
    </script>
    <style>
    .itfixed {width:300px !important; position: fixed; top: 5px; right: 85px;}
    </style>
    <?php }
    add_action('wp_head','meso_add_sticky_sidebar');
    ?>
    Thread Starter Alagi

    (@alagi)

    Hi!, you are awesome, thank you very much, I followed your instructions and it worked, the css needs a few tweaks, but I will be able to sort it out.

    I wish you a merry christmas and a happy new year!.

    Thread Starter Alagi

    (@alagi)

    Ops I forgot to mark the topic as resolved. Done.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to make the sidebar floating / sticky?’ is closed to new replies.