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
hi there, i implemented your nice sticky box on my site. in FF and safari its working perfectly thx. but i got a problem with the ie7. could you have a look on the link i sendet to you and help me up?
Hi, I'm looking for a sticky sidebar solution and found yours through Google.
What I can say is it look great. Thanks for sharing it.
However, after dowloading the mootools framwork I found out it's 65KB. This is a little too heavy for such a simple function. Heavy in term it's 3 times bigger than all the HTML added up.
I know that a standard photo nowadays also is 65KB, but all my graphics added up didn't make 65KB...
So it's a great solution already but may I ask if you know of some other script that's smaller?
Sorry I submit the second comment so quickly. I tested your script and it turned out there is some error in your post. Or should I say, incompatible to other HTML elements.
If you make a sidebox you should name the CSS style #sidebox, not #content.
I copy and pasted it to my page it it floated my entire page content, except the header and footer.
hey there thanks for this, but why is it always behind other graphics on the website, like if it scrolls past an it will go behind it.. it's kinda weird but, help?
Thanx for the great piece of Code. It was exactly what i am searching for. It works perfectly but i have a small question. Is it possible that the sticky sidebar will not move to the top of the page when scrolling? I want to have a small gap on the top of the box and the Browser.
I am not sure wich value i have to change?
Thank you very much...
...Thomas :-)
Als ik onderstaande code in jou html file neer zet kan je niet heel het menu zien (je ziet maar tot en met AB als je met resolutie 1024*768 werkt.
hoe kan ik dat oplossen? heb je een idee.
Verder wil ik je wel bedanken voor deze code
Hi! This is a demo page from Marcofolio.net.
Home
Gastenboek
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
AA
AB
AC
AD
AE
Hello,
I tried to use your code to add a stick sidebar on my website but I have some problem with it... It move when I start to scrtol down and dimension of my website seems to change...
Mybe it is the table I ised to build up my site...
Kindly may you help me?
Please let me know.
Thanks,
Maurizio
I looked at a bit of the code, but to one who has not really ever written any js, it's intimidating. I was wondering how difficult it would be to have the sticky-sidebar on the left side of a webpage. If it isn't too much trouble, could you describe the procedure?
sorry, didnt know the page would react to my code like that.
put the things i put in ( )
() content goes here ()
if this shows the way i want it to, you take out the parenthesis, replace "content goes here" with what you want in the side bar and you should be set.
I am trying to move my advertisements from underneath the description box on my tumblr theme to this sticky bar.
Do I install both the CSS and javascript code or just one of them? Also where in the html coding do I place it?
And how do I place advertisements within the sticky bar? ide:' />
Maar heb ff een vraagje..
Als ik de
boven de zet werken de andere .js niet meer.
Maar als ik deze boven de andere .js zet werkt de rest wel maar de sidebar niet.
Weet jij daar misschien een oplossing voor?
Hey there, I'm using blogger. I was wondering how do I incorporate this with my blogger tepmlate. I have no independent host etc. etc. Please please help me out. I really want a static/sticky side bar for my photo blog in the making.
sleep better birth control pil
-
sleep better birth control pills
2011-06-14 06:44:39
You guys are really wonderful who search and bring such a wonderful info, I am glad to see this time also a useful stuff that had inspired me. Thanks a lot do keep giving us genuine stuff
I enjoy reading the post and have become a great fan of yours. Keep up with the good job and please provide us with great blogs. I really appreciate the research you people take for the posts.
anti smoking pills journal
-
anti smoking pills journal
2011-06-14 06:47:13
I was a great experience to read your post. I found your site from Google and thank a lot for this nice and wonderful information. The information posted was useful and interesting.
hair loss user online reviews
-
hair loss user online reviews
2011-06-14 06:47:47
Thanks a lot for such a wonderful post, the stuff posted were really interesting and useful. The quality of the content was good and clear. Thanks for the post
diet side effects journal
-
diet side effects journal
2011-06-14 06:48:20
I appreciate the ideas posted on your site; they were very informative and innovative. It was worth visiting your site. Thanks a lot for such valuable information.
It is amazing to such useful information at one place. I was looking for the same information from a long time, at last I found it. Thanks for such innovative and amazing information.
I was very pleased to visit your site; I was definitely a wonderful site. The post was worth reading. I enjoyed each bit of your post. Thanks for such excellent post.
hair loss male pills reviews
-
hair loss male pills reviews
2011-06-14 06:53:49
I recently came across your blog and have been reading along. I have no words except to say that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.
I am extremely happy to write a comment on this blog. The information provided on the site was very informative and useful. Thanks a lot for such needy and innovative ideas and concepts.
I really want to thank yahoo search engine who have sent me to this wonderful site. The articles posted on this site are great and amazing. I am glad that I have found this amazing site.
I found this site extremely useful and informative. It is full of all useful stuff and I am glad that I have come across this site. I have made by job much easier, thanks for sharing with us.
I had logged onto this site very recently and found it to be very useful and informative. Each and every concept was well presented. Thanks a lot for the information.
Absolutely great! Can I asl do you know how they created this: http://www.unionstationdenver.com/history/#/timeline
as they seem to use multiple instances of this effect. IIn my testing I changed the sidebar to a header which is situated 300px down the page to start and works exactly how I wanted.
Hi
I love this sidebar, and used it on my little blog (i referenced you, of course!) My only question: Is there anyway to make this transparent/semi-transparent? The way that my site is setup... makes it tricky. I did find a way to eventually get around that, but... I would really prefer a semitransparent sidebar.
Besides that though awesome sidebar. I love this site, it's very... full of knowledge and stuff.
Keira
-
How to create a sticky sidebar or box for your web
2013-03-09 18:25:18
Later on, among the continued practice ending up will continue to be auxiliary accustomed burning the various chords.
Do not overlook this part of your learning. These hail every little
thing played getting rid of barely the sophisticated keys, so you ought to keep effective toward
crush extra listed below barely a limited area of time.
Julian
-
How to create a sticky sidebar or box for your web
2013-04-17 00:02:10
I will immediately clutch your rss feed as I can not to find your
email subscription link or e-newsletter service.
Do you've any? Kindly permit me recognize in order that I could subscribe. Thanks.
Niamh
-
How to create a sticky sidebar or box for your web
2013-04-17 09:25:02
Oh my goodness! Impressive article dude! Thanks, However
I am going through troubles with your RSS. I don't understand why I am unable to join it. Is there anyone else getting identical RSS problems? Anybody who knows the answer will you kindly respond? Thanx!!
Kasey
-
How to create a sticky sidebar or box for your web
2013-05-25 01:45:38
Workout 11 is a low-intensity cardio workout and is often used by
people incredibly important to have your body energized throughout the whole disc order for p90x.
The best way to compare is this - In can be distinct simply because it brings together complex carbs,
low fat proteins and also low-calorie fat.
The amino acids in protein can goal only to have someone in your life talk you out of it?
Augusta
-
How to create a sticky sidebar or box for your web
2013-05-29 12:32:58
For example, California law specifies a this process get
o'er money is transferred to borrower's write up with help of that they
can get all their desires to be fulfilled in veracious clock time.