After my previous article on how to create a peeling corner on your website, I now give you another great thing for your website. I'll explain how to create a sticky sidebar or box that will scroll down with the user. Excellent to put your navigation in, promoting your RSS Feed or placing advertisement.
This technique uses CSS and JavaScript. Works in IE7+, Firefox, Opera and Safari.
Hi!
Try scrolling down on this page. You'll see this box moving down with you. It'll stay on the top-right corner of the page.
This technique uses CSS and JavaScript. Works in IE7+, Firefox, Opera and Safari.
Download Source
View Demo
Enjoy!
If you're reading this, you should be able to see the sticky sidebar on the top-right corner of this page. It'll scroll down with you, but will stop when you scroll up untill the line of my header.
When you're using IE7, please go directly to the demo page to see it working correct. IE7 needs the correct DOCTYPE to make it work and the doctype from my website is another one than the one required for this effect.
That's it! Refresh your page and you should now have your own sticky sidebar on your webpage. Feel free to change the CSS or JavaScript code to your own needs.
There's one catch: It doesn't work in Internet Explorer 6. But since Firefox is taking of the world and IE7 is now more and more used, I still wanted to post this article.
Attached files:
Download Source
View Demo
Where are you going to use the sticky sidebar for?
IE7 would create a huge horizontal scroll for me and when scrolling to the top of the page quickly the box would over shoot before snapping back down into position. I fixed the IE7 problem and improved the snapping by changing
It's been a year since Jeremy Adam Davis started to get more into the design aspect of computers but Jeremy likes to share some things that frustrates him as he makes this push.
If you have worked much with CSS opacity, you know that one of the most frustrating things about it is that by setting it on any page element, it forces it child elements to be transparent also. CSS-Tricks shows a lovely workaround using transparent PNG fills.
Design Bump is a social media site dedicated to design. There are far too few sites focusing on all that design has to offer. It affects us in our daily lives and, if you have a talent for it, you can be a great commodity to society.
Free quality icon packs that'll make you droolIconsPedia is one of the leading resources where you can download high quality icons for free. I gathered a lot of quality icon packs, for your inspiration but you can also use them where you... + Full Story
[Inspiration] The beauty of 3d typographyEverybody loves typography in design. Playing around with characters in an awesome way really gets the attention of the viewer, especially when the typography is in motion.
This article is... + Full Story
This (we)blog brings you information about (web)design, blogging tips, (programming) tutorials and much, much more. I can't describe Marcofolio.net in words: Just look around and be amazed. Many (new) visitors have a habit to stick around, just because of the variety of articles.
This website is entirely run by Marco Kuiper, a guy from the Netherlands. More information can be found on the About Me page. I'm an active member of the StumbleUpon and Digg communities.
Have fun reading my blog and don't forget to subscribe to my feed to keep updated on the latest articles.