Results 1 to 10 of 357

Hybrid View

  1. #1
    Join Date
    Mar 2017
    Location
    auckland
    Posts
    10
    Plugin Contributions
    0

    Default Re: Pure CSS Mega Menu

    Quote Originally Posted by gareththomasnz View Post
    Hi folks - very nice menu & it works fine

    However I want my site to have an Amazon like look & the Amazon Mega Menu has a white background and displays a dark lightbox effect covering everything except the menu & header

    I wonder does anybody have the CSS code to do this?

    I assume its a Z-layer with opacity & layer is a depth below the header & menu which displays on hover?

    I would like to get it working this afternoon fingers crossed
    Heres my additional CSS:
    Code:
    /*LightBox Effect*/
    
    .black_overlay{
    	display: none;
    	position: absolute;
    	top: 0%;
    	left: 0%;
    	width: 100%;
    	height: 100%;
    	background-color: black;
    	z-index:1001;
    	-moz-opacity: 0.8;
    	opacity:.80;
    	filter: alpha(opacity=80);
    }

  2. #2
    Join Date
    Mar 2017
    Location
    auckland
    Posts
    10
    Plugin Contributions
    0

    Default Re: Pure CSS Mega Menu

    Not working yet

    I added the following to tpl_mega_menu.php

    Code:
    <div id="mega-wrapper" "javascript:void(0)" onclick = "document.getElementsByClassName('mega-menu').style.display='block';document.getElementById('fade').style.display='block';"><!-- bof mega-wrapper -->
    
        <ul class="mega-menu menu_red" "javascript:void(0)" onclick = "getElementsByClassName('mega-menu').style.display='none';document.getElementById('fade').style.display='none';"><!-- bof mega-menu -->
    And the following line to tpl_header.php

    Code:
    		  <div id="fade" class="black_overlay"></div>
    After the code that adds the mega menu

    If anybody has suggestions? obviously it must work on hover not click but I want to get it at least to display at all for a start

  3. #3
    Join Date
    Mar 2017
    Location
    auckland
    Posts
    10
    Plugin Contributions
    0

    Default Re: Pure CSS Mega Menu

    Well I changed the display to position:fixed this at least covers the whole page with the display: none turned off

    The inline js works if I show an alert box & I only have the following now:

    Code:
    <ul class="mega-menu menu_red" "javascript:void(0)" onmouseover = "document.getElementById('fade').style.display='block';"><!-- bof mega-menu -->
    Which does not work

    One big problem is that as Zen Cart uses modules to display data & create the page there is no standardization of the stack order

    The stack order of my page elements is all over the show

    As for why the opacity layer does not show - when an alert box does work I do not know. It may just be the stack order.

    Another problem is that I want it to show the header & megamenu bar above the opacity layer without being darkened out.

    At present the menu bar itself and sub menus are showing above the darkened opacity as they should
    Last edited by gareththomasnz; 8 Mar 2017 at 07:44 AM.

  4. #4
    Join Date
    Mar 2017
    Location
    auckland
    Posts
    10
    Plugin Contributions
    0

    Default Re: Pure CSS Mega Menu

    Code:
    <div id="mega-wrapper" onmouseover="document.getElementsByClassName('black_overlay').style.display='block';">
    I cant for the life of me get this to work

    The opacity layer itself works in I remove display:none from the css

    The code above works if I display an alert box - I have even managed to display the class name in the console but it will not display the darn opacity

    Where am I going wrong ?
    Last edited by gareththomasnz; 9 Mar 2017 at 12:33 PM.

  5. #5
    Join Date
    Mar 2017
    Location
    auckland
    Posts
    10
    Plugin Contributions
    0

    Default Re: Pure CSS Mega Menu

    Got it finally & this drove me nuts


    Code:
    <div id="mega-wrapper" onmouseover="document.getElementById('fade').style.display='block';"><!-- bof mega-wrapper -->
    Thats in TPL_MEGA_MENU.PHP

    OK now I just adjust the z-index so the entire header & menubar display above my opacity - perfect

  6. #6
    Join Date
    Mar 2017
    Location
    auckland
    Posts
    10
    Plugin Contributions
    0

    Default Re: Pure CSS Mega Menu

    Final post on this to summarize:

    It now fully works just like the Amazon LightBox Mega Menu

    Four files involved

    .hvmainheader I added z-index:9999; position: relative;

    tpl_mega_menu.php

    Code:
    I added <div id="mega-wrapper" onmouseover="document.getElementById('fade').style.display='block';" onmouseout="document.getElementById('fade').style.display='none';">
    stylesheet_mega_menu.css I added

    Code:
    .black_overlay{
    	display: none;
    	position:fixed;
    	top: 0%;
    	left: 0%;
    	width: 100%;
    	height: 100%;
    	background-color: black;
    	z-index:1000;
    	-moz-opacity: 0.5;
    	opacity:.50;
    	filter: alpha(opacity=50);
    }
    tpl_header.php I added

    <div id="fade" class="black_overlay"></div>

  7. #7
    Join Date
    Dec 2004
    Posts
    1,031
    Plugin Contributions
    0

    Default Re: Pure CSS Mega Menu

    Nice job figuring it out. Can we see the results somewhere? Link?
    Live and learn... the Zen way.

 

 

Similar Threads

  1. Help with Mega Menu css customization
    By swdynamic in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 17 Jul 2013, 01:21 AM
  2. v139h Mega Menu Mess
    By traytray in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 20 Nov 2012, 07:58 PM
  3. v150 Mega Menu assistance
    By Fancyfrills in forum Templates, Stylesheets, Page Layout
    Replies: 18
    Last Post: 24 Aug 2012, 06:16 PM
  4. Horizontal Drop Menu sort order of mega-menu
    By familynow in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 19 Oct 2011, 04:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg