(c) 2007, DHTML-Menu.com
  Recent Questions
  Write To Support

    How can I hide my up menu javascript when I print my page?

Return to Recent Questions

Q: Can I use javascript to get the object ID (getElementByID). If not how do I hide my up menu javascript when I print the page?

A: You can add a new button to print your page and call onClick event, so you should write:
<body ....
onClick="document.getElementById('dm0m0').style.visibility='hidden'; window.print();">
Or you can use the same javascript code from your menu item.

For example:
var menuItems = [
["Print", "javascript:document.getElementById('dm0m0').style.visibility='hidden';
window.print();", icon1, icon2],
But if you want to hide the up menu javascript when your customers push "File/Print" you should write so:
Create two functions, for example:

function myprint()
{ document.getElementById('dm0m0').style.visibility='hidden';
function myprint2()
{ document.getElementById('dm0m0').style.visibility='visible';
You should add this functions into your code.

And then you must write the following code:

window.onbeforeprint = myprint;
window.onafterprint = myprint2;

Return to Recent Questions

Copyright (c) 2012, DHTML-Menu.com
Home  |  Product Info  |  Samples  |  Download  |  Purchase  |  FAQ  |  Site Map  |  Write Us
All rights reserved. html website maker | top free website builder | bootstrap navbar examples | HTML5 Video Player | responsive slider