• 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

This Article Has Been Shared 280 Times!

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

  • 5 SEO plugins for WordPress

    Here are five popular SEO plugins for Wordpress which can help your blog running better.

  • Dublin core, Google and SEO

    What is Dublin core? Does Google reads Dublin core? Has Dublin core any effect on SEO? Many questions are answered about Dublin core through the knowledge gathered throughout the Internet.

  • Newsletter Plugins for WordPress and Newsletter Delivery Options

    Newsletter Plugins for WordPress are needed for Professional, Bussiness and Personal WordPress based websites or Blogs. Along with the Newsletter Plugins for WordPress, we will discuss about the Newsletter Delivery Options.

  • WordPress FTP Full Backup : Backup FTP to ZIP File

    WordPress FTP Full Backup is a WordPress Plugin to backup your WordPress FTP using PHP ZipArchive to a ZIP file, save it on server and gives option to download.

  • WP Super Cache With Rackspace Cloud Files CDN (Open Cloud)

    WP Super Cache With Rackspace Cloud Files CDN guide is an update due to change of technology by using Open Cloud.The Streaming Media need to be used separately.

Additionally, 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 (22.1K 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

  • The Future Of Serverless: The Load-Intensive Workload Case May 25, 2022
  • Cutting Out The Coding: Serverless Computing In Action May 24, 2022
  • Types of Blackjack Variants: Discover the Different Versions of the Game May 23, 2022
  • How Cloud, Robotics And Sensor Technologies Are Changing The Business Landscape May 23, 2022
  • Modernizing Your Business With a Hybrid Cloud Strategy May 22, 2022

About This Article

Cite this article as: Abhishek Ghosh, "WordPress Sticky Floating Widget or Menu Without Plugin," in The Customize Windows, April 1, 2016, May 25, 2022, https://thecustomizewindows.com/2016/04/wordpress-sticky-floating-widget-or-menu-without-plugin/.

Source:The Customize Windows, JiMA.in

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Privacy Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

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

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