Blogger Blog Sidebar Me Sticky Widget Kaise Add Kare


(Anoop Bhatt) #1

sir aapke blog par jab post page ko scroll karo to sidebaar stop ho jata hai lekin post scroll hoti rahti hai to iske liye blogger blog par kon sa code add hoga


(Jumedeen khan) #2

Blogger dashboard >> theme >> edit html option par jao aur </head> ya </body> section me ye code add karo.

<script>http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js</script>
<script type='text/javascript'>
    //<![CDATA[
    $(function() {
        if ($('#PopularPosts1').length) {
            var el = $('#PopularPosts1');
            var stickyTop = $('#PopularPosts1').offset().top;
            var stickyHeight = $('#PopularPosts1').height();
            $(window).scroll(function() {
                var limit = $('#footer-wrapper').offset().top - stickyHeight - 20;
                var windowTop = $(window).scrollTop();
                if (stickyTop < windowTop) {
                    el.css({
                        position: 'fixed',
                        top: 20
                    });
                } else {
                    el.css('position', 'static');
                }
                if (limit < windowTop) {
                    var diff = limit - windowTop;
                    el.css({
                        top: diff
                    });
                }
            });
        }
    });
    //]]>
</script>

Setting save karne se pahle “PopularPosts1” ki jagah widget id change kar lena. Aur ye css code add karna mat bhulna taki mobile me widget fixed na ho.

@media only screen and (min-width:260px) and (max-width:989px){
#PopularPosts1{display: none!important;}}

For more information view source.


(Arunesh Kumar) #3

kya ye sife blogger k liye hai wordpress me isse use nahi kar skta hu mai


(Jumedeen khan) #4

Yes ye blogger ke liye hai wordpress me fixed widget ke liye aap Q2W3 Fixed Widget plugin use karo.


(Arunesh Kumar) #5

ok sir thanks:sunglasses:


(Anoop Bhatt) #6

sir sorry lekin ye mere blog par kaam nahi kar rah pata nahi kyun jabhi maine ise head end tag or body end tag me add kiya mere widget id bhi change kiya lekin nahi hua


(Jumedeen khan) #7

isme 3 id ha jo aapko change karni hai. Code me jaha “#” laga hua hai un id ki jagah aapko sidebar widget id aur footer id add karni hai. Maine source code bhi diya hai uske sabkuch details se btaya hua hai.