•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 427,462 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,620 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 3528 | Replies: 2
![]() |
•
•
Join Date: Nov 2006
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
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
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 12:42 pm.
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++ }
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++ }
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Flash-XML Menu (Web Design Tutorials)
- how to create pop up menu in VC++.NET (C++)
- create menu base on database data (VB.NET)
- For some reason program installations cannot create new start menu shortcuts... (Windows NT / 2000 / XP / 2003)
- Help with dynamic menu (HTML and CSS)
- Problems creating a DHTML menu script with a stylish dropdown menu (JavaScript / DHTML / AJAX)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Scrollbar position on refresh problem
- Next Thread: XMLHttpRequest, out of the FF frying pan, into the IE frying pan.



Linear Mode