Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Menu with fixed top and relative left

Menu with fixed top and relative left

Problem

The facebook appcenter menu has Fixed top and Relative Left. It looks like it's updating from javascript. Does anyone know how to do that? Or if there is a plugin out there like this? I can't for the life of me find it.

http://www.facebook.com/appcenter/?from_bookmark=1

Problem courtesy of: Kyle

Solution

Position: fixed

http://www.w3schools.com/cssref/playit.asp?filename=playcss_position&preval=fixed

This fiddle demonstrates a fixed element with a dynamic "left" value using jQuery http://jsfiddle.net/Tws2W/.

Code of interest:

$(window).resize(function() 
{
  $('#fixed').css('left', Math.max(($(window).width() - 400), 0) + 'px');
});​
Solution courtesy of: Paul Fleming

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

Menu with fixed top and relative left

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×