954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to create floating menu

Hi, i'm trying to make a menu that will follow me as I scroll down the window,
somethins like this, (look on the right and on the left)
please use IE to see, firefox doesn't display properly

http://www.gmarket.co.kr/challenge/neo_category/html_small_category/small_category_300004054.asp?gdsc_cd=300004054&link_type=LIST

i have found some java script, however I want the menu move smoothly as i scroll, any help is appreciated

jcisml
Newbie Poster
6 posts since Nov 2006
Reputation Points: 10
Solved Threads: 0
 

Research the JavaScript "scrollto" functions. I've moved this thread to the proper forum.

tgreer
Made Her Cry
Team Colleague
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
 

FF allows the style "position:fixed;". That will fix the element in a certain position relative to the screen.
You can emulate it with IE and other browsers by creating a DIV as the first child of the body to emulate the body.
Remove all padding, spacing, borders from the BODY and also set "scroll:none;overflow:hidden;" in CSS and in javascript disable the scroll.
Then give your DIV thats emulating the body a overflow:auto;.

Then when you want to make a DIV fixed, just place it outside the DIV that you are using as the BODY, and make it absolutely positioned.

See an example: http://tagsoup.com/cookbook/css/fixed/

This is better to moving the Element when onscroll is triggered.

If you want to go with onscroll event, then don't jump directly to the scroll offset, use an incremental approach...

pseudo code:
while (body_scroll_offset > absolute_div_position) { absolute_div_position++ }

digital-ether
Nearly a Posting Virtuoso
Moderator
1,293 posts since Sep 2005
Reputation Points: 461
Solved Threads: 101
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You