Results 1 to 10 of 10
  1. #1
    Wahahaha~! Faun's Avatar
    Join Date
    Dec 2006
    Location
    Pune/there
    Posts
    8,447

    Default Floating menu CSS

    How do I make the floating menu like this website:
    EON11-S Custom Gaming Laptop Product Features and Details | ORIGIN PC

    Currently it's like this on my website:
    psygeist

    Floating menu should move up once the user scroll past the header.
    Steam | Flickr | Battlelog
    Spoiler:
    Asus Z68 V-Pro|i5 2500k|TRUE Black|Ripjaws X|U2311H|N560GTX Ti|D7000|Classic Vibe 50 Strat|XONAR STX|RE272|UM Miracle|Optimus G

    Mono

  2. #2
    Human Spambot abhidev's Avatar
    Join Date
    Sep 2009
    Posts
    2,170

    Default 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

  3. #3
    Wahahaha~! Faun's Avatar
    Join Date
    Dec 2006
    Location
    Pune/there
    Posts
    8,447

    Default Re: Floating menu CSS

    I am not talking about the header but the sidebar on right in my website and the siderbar on left in the origin website.
    Steam | Flickr | Battlelog
    Spoiler:
    Asus Z68 V-Pro|i5 2500k|TRUE Black|Ripjaws X|U2311H|N560GTX Ti|D7000|Classic Vibe 50 Strat|XONAR STX|RE272|UM Miracle|Optimus G

    Mono

  4. #4
    Rubik's Uncle!! RCuber's Avatar
    Join Date
    Sep 2004
    Location
    ಬೆಂಗಳೂರು (Bengaluru)
    Posts
    5,869

    Default Re: Floating menu CSS

    currently is working similarly in your website!!! did you update it now?
    the cake is a lie
    621311.251521

  5. #5
    Wahahaha~! Faun's Avatar
    Join Date
    Dec 2006
    Location
    Pune/there
    Posts
    8,447

    Default Re: Floating menu CSS

    Quote Originally Posted by RCuber View Post
    currently is working similarly in your website!!! did you update it now?
    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

    position:absolute; top:150px;
    to
    position:fixed; top:15px;
    I guess javascript is used to change is dynamically.

    It just counts the length scrolled in pixels and then applies second style to the element.
    Last edited by Faun; 15-06-2012 at 10:11 PM.
    Steam | Flickr | Battlelog
    Spoiler:
    Asus Z68 V-Pro|i5 2500k|TRUE Black|Ripjaws X|U2311H|N560GTX Ti|D7000|Classic Vibe 50 Strat|XONAR STX|RE272|UM Miracle|Optimus G

    Mono

  6. #6
    Rubik's Uncle!! RCuber's Avatar
    Join Date
    Sep 2004
    Location
    ಬೆಂಗಳೂರು (Bengaluru)
    Posts
    5,869

    Default Re: Floating menu CSS

    there is a div with a height of 15px .. if I remove that it it works similarly..


    Uploaded with ImageShack.us
    the cake is a lie
    621311.251521

  7. #7
    Wahahaha~! Faun's Avatar
    Join Date
    Dec 2006
    Location
    Pune/there
    Posts
    8,447

    Default Re: Floating menu CSS

    ^^not quite what I am looking for

    This is the code

    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>
    DONE !!! Cool effect IMO.
    Last edited by Faun; 15-06-2012 at 11:17 PM.
    Steam | Flickr | Battlelog
    Spoiler:
    Asus Z68 V-Pro|i5 2500k|TRUE Black|Ripjaws X|U2311H|N560GTX Ti|D7000|Classic Vibe 50 Strat|XONAR STX|RE272|UM Miracle|Optimus G

    Mono

  8. #8
    Rubik's Uncle!! RCuber's Avatar
    Join Date
    Sep 2004
    Location
    ಬೆಂಗಳೂರು (Bengaluru)
    Posts
    5,869

    Default Re: Floating menu CSS

    Cool!! Thanks for sharing

    EDIT: Where did you find it?
    the cake is a lie
    621311.251521

  9. #9
    Human Spambot abhidev's Avatar
    Join Date
    Sep 2009
    Posts
    2,170

    Default 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

  10. #10
    Wahahaha~! Faun's Avatar
    Join Date
    Dec 2006
    Location
    Pune/there
    Posts
    8,447

    Default Re: Floating menu CSS

    Quote Originally Posted by RCuber View Post
    Cool!! Thanks for sharing

    EDIT: Where did you find it?
    It was in the website itself.
    Steam | Flickr | Battlelog
    Spoiler:
    Asus Z68 V-Pro|i5 2500k|TRUE Black|Ripjaws X|U2311H|N560GTX Ti|D7000|Classic Vibe 50 Strat|XONAR STX|RE272|UM Miracle|Optimus G

    Mono

Similar Threads

  1. multiplication of floating number in php
    By Sridhar_Rao in forum Programming
    Replies: 1
    Last Post: 15-06-2008, 05:02 PM
  2. my screen is floating
    By hidayath7 in forum Hardware Q&A
    Replies: 15
    Last Post: 21-05-2008, 12:38 AM
  3. Replies: 12
    Last Post: 17-08-2007, 07:44 PM
  4. Solar-Powered Floating Globe
    By Voldy in forum Technology News
    Replies: 3
    Last Post: 30-06-2007, 11:38 AM
  5. just floating helpless in japan
    By subraj in forum Software Q&A
    Replies: 1
    Last Post: 30-03-2006, 04:49 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Close