dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Javascript mega menu

  1. #1
    Join Date
    Jun 2014
    Posts
    1

    Javascript mega menu

    Hi all, im making a magento site, and i wanted it to have a megamenu.

    i wanted to use nonadjacent divs so i had to use javascript rather than just css, and i wanted the menu to slide down, and up, but to not slide up and down *if* it is already down.

    so this is what i came up with. its my first javascript, so i wanted some feedback?

    i guess it could be cut down by writing some functions like windowhide, windowshow, and so on, and eliminate much of the repetitve code, but so long as its functional, i dont mind a few extra lines for now.

    if its rubbish, i might just take out the animations and go back to a simple show on mouseover, hide on mouseout affair. but i thought having it slide would add a slightly more polished look for my site, persuade customers to buy more, retire in 2 years, and then live on a yacht in monaco.

    so, what i am asking is, is it ok to use? or shall i bin it? here is the fiddle : http://jsfiddle.net/mikenothing/p5ZXy/32/

  2. #2
    Honestly, scrap the JS for nothing and build it with CSS. There is NO reason to use JS on a menu unless you REALLY need that IE6 support, and then just throw a .htc at it like PeterNed's Anywhere:hover

    Especially if it means getting fat bloated battery chewing garbage like jQuery involved in pissing all over the page. Sorry, not a fan.

    Of course, the classes on the DIV makes me think you are using some sort of HTML/CSS framework as well, further crapping on the page with unnecessary code that defeats the entire reason HTML and CSS even exists, so scrap that too. Moment I see classes like "nine columns omega" I know something is awry. Same goes for when the dropdowns are not contained in the LI of their parent, having NO semantic or structural relationship.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles