943,186 Members | Top Members by Rank

Ad:
Nov 5th, 2006
0

how to create floating menu

Expand Post »
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/n...link_type=LIST

i have found some java script, however I want the menu move smoothly as i scroll, any help is appreciated
Last edited by jcisml; Nov 5th, 2006 at 1:42 pm.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jcisml is offline Offline
6 posts
since Nov 2006
Nov 5th, 2006
0

Re: how to create floating menu

Research the JavaScript "scrollto" functions. I've moved this thread to the proper forum.
Team Colleague
Reputation Points: 227
Solved Threads: 37
Made Her Cry
tgreer is offline Offline
1,697 posts
since Dec 2004
Nov 6th, 2006
0

Re: how to create floating menu

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++ }
Moderator
Reputation Points: 457
Solved Threads: 101
Nearly a Posting Virtuoso
digital-ether is offline Offline
1,250 posts
since Sep 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: Scrollbar position on refresh problem
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: XMLHttpRequest, out of the FF frying pan, into the IE frying pan.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC