Results 1 to 7 of 7

Thread: offset menu

  1. #1
    Join Date
    May 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default offset menu

    1) Script Title: Chrome CSS Drop Down Menu (v2.5)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/chrome/

    3) Describe problem: on www.jaybee.co.uk/cliovan.php I have includedd the script in a pho includes....
    but as you can see the drop down menus become off set? do not understand why?

    kind regards


    Queslett

  2. #2
    Join Date
    Aug 2004
    Posts
    10,140
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Most of the positioning problems with the drop down menus can be solved by making sure the HTML for the drop down DIVs themselves is outside any container tag on the page other than the BODY. So in your case, try moving all the drop down DIVs to the bottom of your page, just above the "</body>" tag:

    Code:
    <!--1st drop down menu -->                                                   
    <div id="dropmenu2" class="dropmenudiv">
    <a href="http://jaybee.co.uk/twingoextreme.php">Twingo Extreme</a>
    <a href="http://jaybee.co.uk/twingodynamique.php">Twingo Dynamique</a>
    <a href="http://jaybee.co.uk/twingogt.php">Twingo GT</a>
    <a href="http://jaybee.co.uk/twingosport.php">Twingo Renaultsport 133</a>
    
    <a href="http://jaybee.co.uk/cliothreedoor.php">Clio 3-door</a>
    <a href="http://jaybee.co.uk/cliofivedoor.php">Clio 3-door</a>
    
    </div>
    
    
    <!--2nd drop down menu -->                                                
    <div id="dropmenu3" class="dropmenudiv" style="width: 150px;">
    <a href="http://www.cnn.com/">CNN</a>
    <a href="http://www.msnbc.com">MSNBC</a>
    <a href="http://news.bbc.co.uk">BBC News</a>
    </div>
    
    <!--3rd drop down menu -->                                                   
    <div id="dropmenu4" class="dropmenudiv" style="width: 150px;">
    <a href="http://www.google.com/">Google</a>
    <a href="http://www.yahoo.com">Yahoo</a>
    <a href="http://www.msn.com">MSN</a>
    </div>
    
    
    <script type="text/javascript">
    
    cssdropdown.startchrome("chromemenu")
    
    </script>
    
    </body>
    DD Admin

  3. #3
    Join Date
    May 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I understand what you have said above, but its in an "includes" so it will appear on every page

    so how do I get around that as the includes has to appear in a div in order to place it in the correct position or is there another way of doing this?

  4. #4
    Join Date
    May 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ok these are just the last few lines of my code showing you where I have placed the chrome menu code

    PHP Code:
    <div class="jaybeeright2">
        <?php include ("includes/renaultoffers.php"); ?>
      </div>

      <div class="jaybeeaddress">
        <?php include ("includes/jaybeeaddress.php"); ?>
      </div>
          <div class="navigation">
        <?php include ("includes/chromemenu/demo.php"); ?>
      </div>
    </div>
    </body>
    </html>
    Last edited by Snookerman; 05-15-2009 at 05:40 AM. Reason: added [php] tags

  5. #5
    Join Date
    Aug 2004
    Posts
    10,140
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    One thing you can try if you can't manually move the HTML for the drop down DIVs to the end of the page is to do so via scripting. Try finding the line in red below inside the .js file, and add to it the following:

    Code:
    				this.addEvent(menuitems[i], function(){cssdropdown.delayhidemenu()}, "click") //hide drop down menu when main menu items are clicked on
    				this.addEvent(window, function(){document.body.appendChild(relvalue)}, "load")
    Untested, but worth a shot.
    DD Admin

  6. #6
    Join Date
    May 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    i have added the code as outlined and i still get the same effect... smiles

    I appreciate your help.

  7. #7
    Join Date
    Aug 2004
    Posts
    10,140
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Ah yes, there was an error in the new line I posted. It should be the following instead:

    Code:
    this.addEvent(window, function(){document.body.appendChild(asscdropdownmenu)}, "load")
    DD Admin

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
  •