Results 1 to 5 of 5

Thread: Stop javascript menu showing when printing

  1. #1
    Join Date
    Apr 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Stop javascript menu showing when printing

    Hi

    I'm using a Dynamic Drive javascript menu created by Ger Versluis.
    "Ger Versluis 2000 version 5.411 - 24 December 2001 (updated Jan 31st, 2003 by Dynamic Drive for Opera7)"

    I'm wanting to set the javascript menu to not display within my print stylesheet.

    I've tried adding a div id="nav" around the javascript within my header and setting it to 'display: none' in my print stylesheet, i.e.

    <div id="nav">
    <!-- HV menu to configure look at exemplmenu -->
    <script type='text/javascript'>
    //HV Menu v5.411- by Ger Versluis (http://www.burmees.nl/)

    function Go(){return}
    </script>
    <script type="text/javascript" src="HSW_exmplmenu_var.js" class="nav"></script>
    <script type="text/javascript" src="HSW_menu_com.js" class="nav"></script>
    <noscript></noscript>
    <!-- end HV -->
    </div>

    I've also tried adding class="nav" within each link above and setting that to display: none.

    Neither of these methods are removing the navigation menu when printing.

    Can anyone give me any ideas on how to remove the navigation? Here's the test link.

    http://www.virtuallee.co.uk/HSW/index.php

    Thanks. Much appreciated!
    Lee

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Code:
    <style type="text/css">
    @media print {
      #nav {
        display: none;
      }
    }
    </style>
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Apr 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi

    Thanks for getting back! Your suggestion looks correct, but it's still not working. I've tried all sorts of combinations using div id="nav" and class="nav" within various parts of the javascript code, i.e.

    <style type="text/css">
    @media print {
    .nav {
    display: none;
    }
    }
    </style>

    <script type="text/javascript" class="nav">
    //HV Menu v5.411- by Ger Versluis (http://www.burmees.nl/)

    function Go(){return}
    </script>
    <script type="text/javascript" src="HSW_exmplmenu_var.js" class="nav"></script>
    <script type="text/javascript" src="HSW_menu_com.js" class="nav"></script>
    <noscript></noscript>

    It's still not hiding the javascript menu. Do you think I need to add something to the actual .js file? It really should be as simple as adding a div around the javascript and setting it to display none..not sure why it's not working.

    http://www.virtuallee.co.uk/HSW/index.php

    Do you have any other ideas?

    Thanks v.much.
    Lee

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Well, I did a print preview of your page and only the items with the class of 'menuItem' were showing in up in both IE and FF modes in NS8. So, I'd try Twey's idea, which is essentially correct and apply it to this class. Do this either in addition to what you already were using (if that is required to hide other parts of the menu) or alone, ex:

    Code:
    <style type="text/css">
    @media print {
    #nav, .menuItem {
    display: none;
    }
    }
    </style>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jan 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi Lee, I see its not printing on your page, what worked in the end?

    having the same trouble....

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
  •