hovering navigation div

This is a discussion on "hovering navigation div" within the Web Page Design section. This forum, and the thread "hovering navigation div are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Feb 22nd, 2007, 14:07
Junior Member
Join Date: Dec 2005
Location: Dublin
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
hovering navigation div

Hi,

Does anyone know way to "hover" a div along the bottom of a page above all other content so that when you scroll down the page it stays static on the bottom of the page, while everything else scrolls.

Im not sure if you can do this in CSS, maybe you need JS??

Last edited by karinne; Feb 23rd, 2007 at 13:05. Reason: Fixed the random overwrite.
Reply With Quote

  #2 (permalink)  
Old Feb 22nd, 2007, 14:15
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: hovering navigation div

By using position: fixed it works in all the good browsers. To compensate for IE6's lack of ... well ... everything, you need javascript yes...

Last edited by karinne; Feb 22nd, 2007 at 15:01.
Reply With Quote
  #3 (permalink)  
Old Feb 22nd, 2007, 22:48
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: hovering navigation div

No you don't need JavaScript.

Use position: fixed;

You can do it with JS, but it looks MUCH better using CSS.
Reply With Quote
  #4 (permalink)  
Old Feb 23rd, 2007, 11:45
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: hovering navigation div

Quote:
Originally Posted by Ryan Fait View Post
No you don't need JavaScript.

Use position: fixed;
Ryan ... position: fixed; doesn't work in IE6
Reply With Quote
  #5 (permalink)  
Old Feb 23rd, 2007, 13:00
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: hovering navigation div

http://tagsoup.com/cookbook/css/fixed/
Reply With Quote
  #6 (permalink)  
Old Feb 23rd, 2007, 13:04
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: hovering navigation div

Let me re-phrase that

Ryan ... position: fixed; doesn't work in IE6 unless you hack it to death

Bah ... what's one more hack eh?
Reply With Quote
  #7 (permalink)  
Old Feb 23rd, 2007, 13:10
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: hovering navigation div

Gotta do what you have to do as long as it's a graceful degradation.
Reply With Quote
  #8 (permalink)  
Old Feb 23rd, 2007, 17:37
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: hovering navigation div

Ok ... here ... it's not pretty but this works

HTML: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-CA" xml:lang="EN-CA">

<head>
    <title>Some title</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <style type="text/css">
    * {
        margin: 0;
        padding: 0;
    }
    
    #leftit {
        float: right;
        width: 350px;
    }
    
    .fixedbox {
        position: absolute;
        width: 120px;
        height: 75px;
        border: 1px solid #900;
        background-color: #ccc;
        color: #000
    }
    @media screen {
        div.fixedbox {
            position: fixed;
        }
        
        * html {
            overflow-y: hidden;
        }
        * html body {
            height: 100%;
            overflow: auto;
        }
        * html div.fixedbox {
            position: absolute;  
        }
    }
    </style>
    
</head>

<body>
<div id="leftit"><div class="fixedbox">This stays in place as you scroll!</div></div>
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />
bbaa lba lba<br />

</body>
</html>
Reply With Quote
  #9 (permalink)  
Old Feb 23rd, 2007, 20:56
Junior Member
Join Date: Dec 2005
Location: Dublin
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Re: hovering navigation div

wow thats really useful, thanks! works with IE6 too, even better!
Reply With Quote
Reply

Tags
div, hover

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Navigation inkz Web Page Design 2 Apr 22nd, 2008 15:33
CSS Navigation Help penguin Starting Out 3 Mar 15th, 2008 13:43
Navigation help elephantinc Flash & Multimedia Forum 9 Feb 13th, 2008 22:46
Color for hovering links skitson Web Page Design 2 Feb 3rd, 2008 06:29
CSS navigation AdRock Web Page Design 1 Jul 15th, 2006 10:56


All times are GMT. The time now is 16:00.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43