• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » WordPress Sticky Floating Widget or Menu Without Plugin

By Abhishek Ghosh April 1, 2016 12:56 pm Updated on April 1, 2016

WordPress Sticky Floating Widget or Menu Without Plugin

Advertisement

It is quite funny, but factually many a times we can do far better, more customized works without any plugin. WordPress Sticky Floating Widget or Menu Without Plugin is Possible to Deploy via jQuery or CSS. We Can Logically Use that for Post Pages. Q2W3 Fixed Widget is a well known WordPress Plugin which is easy if you fear minimal coding. We will give an approximate example, you need to customize it for your own design.

 

Why We Need WordPress Sticky Floating Widget or Menu Without Plugin?

 

Sidebar is a crucial aspect for a professional look. When the reader scrolls down a longer post page, the sidebar ends and that space remains empty. None can write similar sized posts. Websites with wordPress sticky floating widget or menu, one sidebar widget will stick and float along with the scrolling down of the longer post page. This is useful for you to get more attention to one of your sidebar widget. 5 years ago, we wrote what to put on a sidebar, that is not exactly the topic we are discussing in this guide. You may read later.

It does not need explanation – using more plugins is more bad.

Advertisement

---

WordPress Sticky Floating Widget or Menu Without Plugin

 

WordPress Sticky Floating Widget or Menu Without Plugin : Via CSS or JS

 

We can inject an inline CSS or Js with Header and Footer plugin or Genesis Plugin for Genesis Theme Framework. The working principle is same as we used in Drop Caps without Plugin. jQuery loads in normal WordPress front-end. So, it is just easy to use jQuery plugin. Hartley wrote a great way, which you may read for full technical details :

Vim
1
https://blog.hartleybrody.com/creating-sticky-sidebar-widgets-that-scrolls-with-you/

What he did is an easy trick, if you wrap with catcher and sticky div class,

Vim
1
2
3
4
5
6
7
<div id="catcher">
    <!--stuffs here-->
</div>
<div id="sticky">
    <!--more stuffs here-->
</div>

and add this jQuery written by him (and customize after reading his detailed guide), it is just easy :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<script>
$(document).ready(function() {
        function isScrolledTo(elem) {
            var docViewTop = $(window).scrollTop(); //num of pixels hidden above current screen
            var docViewBottom = docViewTop + $(window).height();
            var elemTop = $(elem).offset().top; //num of pixels above the elem
            var elemBottom = elemTop + $(elem).height();
            return ((elemTop <= docViewTop));
        }
        var catcher = $('#catcher');
        var sticky = $('#sticky');
        $(window).scroll(function() {
            if(isScrolledTo(sticky)) {
                sticky.css('position','fixed');
                sticky.css('top','0px');
            }
            var stopHeight = catcher.offset().top + catcher.height();
            if ( stopHeight > sticky.offset().top) {
                sticky.css('position','absolute');
                sticky.css('top',stopHeight);
            }
        });
    });
</script>

WP Enqueue Script can be used to inject the javascript and put it to footer.

Funnily, it is more easier with CSS. With CSS position:fixed, we can easily active the same result in more easy way. If you wrap a div with :

Vim
1
2
3
<div id="sticky">
    <!-- stuffs here-->
</div>

and adjust the parameters, you can easily get that fun :

Vim
1
.sticky { position: fixed; top: 30px; width: 292px; }

Tagged With how to fix widget in WordPress without plugin , sticky sidebar without plugin wordpress , sticky widget without plugin , wordpress sticky menu on scroll without plugin 2018 , wordpress sticky posts without a plugin
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to WordPress Sticky Floating Widget or Menu Without Plugin

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • How to Correctly Include jQuery-UI Effects on WordPress

    How to correctly include JQuery-UI effects on WordPress on your existing Theme without much compromise on Page Loading Speed? It is made easy with our Guide.

  • WordPress & PHP : Different AdSense Units on Mobile Devices

    Here is How To Serve Different AdSense Units on Mobile Devices on WordPress With PHP. WordPress Has Function Which Can Be Used In Free Way.

  • Changing Data With cURL for OpenStack Swift (HP Cloud CDN)

    Changing Data With cURL For Object is Quite Easy in OpenStack Swift. Here Are Examples With HP Cloud CDN To Make it Clear. Official Examples Are Bad.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • PowerAmp Settings for Higher Sound QualityOctober 4, 2023
  • Affordable Earphone/IEM for Audiophiles: HiFiMan RE-400 WaterlineOctober 2, 2023
  • What is Hardware Security Module (HSM)September 30, 2023
  • Transducer Technologies of HeadphonesSeptember 28, 2023
  • What is Analog-to-Digital Converter (ADC)September 27, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy