All, I'm using Wordpress widgets but I'd like to create a widget that floats down with the page as your scroll. Has anyone ever done anything like this? If so, can you give any remendations on how to achieve such a widget? Is it done merely by Javascript/CSS?
Thanks!
All, I'm using Wordpress widgets but I'd like to create a widget that floats down with the page as your scroll. Has anyone ever done anything like this? If so, can you give any remendations on how to achieve such a widget? Is it done merely by Javascript/CSS?
Thanks!
Share Improve this question asked Feb 27, 2012 at 19:18 user1048676user1048676 10.1k26 gold badges86 silver badges120 bronze badges 1-
Read about
position:fixed
davidwalsh.name/css-fixed-position – Cheery Commented Feb 27, 2012 at 19:20
4 Answers
Reset to default 4The easiest way - to install this new WordPress plugin - Q2W3 Fixed Widget
It was specifically designed for this purpose!
Screenshots
All you need to do is set the position of the element in question to fixed
via CSS, i.e.
.myFloatingWidget {position:fixed; left:0px; top:50%}
You need to give the widget a style of position:fixed;
. Example at W3Schools.
slashnick's and maxedison's solutions will work.
If you'd like to have a dynamic scrolling box that doesn't always stay on the screen or minds the header, footer or any other div of your site, you might want to check out DropTheBit's sticky float jQuery plugin: http://dropthebit./74/sticky-floating-box/