Results 1 to 10 of 10
Thread: Floating menu CSS
-
15-06-2012, 06:36 PM #1
-
15-06-2012, 08:57 PM #2
Re: Floating menu CSS
its easy....
<ul class="nav">
<li><a href="http://psygeist.com">Home</a><div class="sub_menu">Sub menu</div></li>
<li class="page_item page-item-2"><a href="http://psygeist.com/about-me/">About Me</a><div class="sub_menu">Sub menu</div></li>
</ul>
note the div I have added....and in the css
it would be like this
.nav li{ position:relative;}
.nav li .sub_menu{ display:none; position:absolute; top:/*your main menu height*/px; left:0; }
.nav li:hover .sub_menu{ display:block; }Core 2 duo E4500 2.2gHz , ASUS P5GCMX , 3GB Transcend , Corsair VX 550w, MSI R5770 HAWK Edition 1GB, CM HAF-922, LG W2243T 21.5" LCD, I-Ball Baton
-
15-06-2012, 09:53 PM #3
-
15-06-2012, 09:58 PM #4
Re: Floating menu CSS
currently is working similarly in your website!!! did you update it now?
the cake is a lie
621311.251521
-
15-06-2012, 10:06 PM #5
Re: Floating menu CSS
Yes but it stays a little low from the upper most part. It should stick to the upper most part when the user has scrolled past header of the website.
See the origin website. There, it moves till the upper header is gone from scroll area and then it sticks there just a few pixels below the upper most part of page.
EON11-S Custom Gaming Laptop Product Features and Details | ORIGIN PC
The difference is noticeable.
Ok I just saw that the CSS value changes dynamically from
toposition:absolute; top:150px;
I guess javascript is used to change is dynamically.position:fixed; top:15px;
It just counts the length scrolled in pixels and then applies second style to the element.
-
15-06-2012, 10:25 PM #6
Re: Floating menu CSS
there is a div with a height of 15px .. if I remove that it it works similarly..

Uploaded with ImageShack.usthe cake is a lie
621311.251521
-
15-06-2012, 11:09 PM #7
Re: Floating menu CSS
^^not quite what I am looking for
This is the code
DONE !!! Cool effect IMO.Code:<script type="text/javascript"> //<![CDATA[ // mini-cart Floater window.onscroll = function() { if (document.documentElement.scrollTop > 135 || window.pageYOffset > 135) { if(window.navigator.appVersion.indexOf("IE 6.0")!= -1) { document.getElementById('floater').style.top = (document.documentElement.scrollTop + 15 ) + "px"; } else{ document.getElementById('floater').style.position = 'fixed'; document.getElementById('floater').style.top = '15px'; } } else if (document.documentElement.scrollTop < 135 || window.pageYOffset < 135) { document.getElementById('floater').style.position = 'absolute'; document.getElementById('floater').style.top = '150px'; } } //]]> </script>
-
16-06-2012, 01:07 AM #8
Re: Floating menu CSS
Cool!! Thanks for sharing

EDIT: Where did you find it?the cake is a lie
621311.251521
-
16-06-2012, 09:45 AM #9
Re: Floating menu CSS
oh.....
Core 2 duo E4500 2.2gHz , ASUS P5GCMX , 3GB Transcend , Corsair VX 550w, MSI R5770 HAWK Edition 1GB, CM HAF-922, LG W2243T 21.5" LCD, I-Ball Baton
-
21-06-2012, 12:23 PM #10
Similar Threads
-
multiplication of floating number in php
By Sridhar_Rao in forum ProgrammingReplies: 1Last Post: 15-06-2008, 05:02 PM -
my screen is floating
By hidayath7 in forum Hardware Q&AReplies: 15Last Post: 21-05-2008, 12:38 AM -
Mumbai to have a floating “Planet Hollywood” restaurant
By iMav in forum Random NewsReplies: 12Last Post: 17-08-2007, 07:44 PM -
Solar-Powered Floating Globe
By Voldy in forum Technology NewsReplies: 3Last Post: 30-06-2007, 11:38 AM -
just floating helpless in japan
By subraj in forum Software Q&AReplies: 1Last Post: 30-03-2006, 04:49 PM



LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks