Deprecated: Function split() is deprecated in /home/dxmenu/public_html/data/support/rqfunc.php on line 13

Deprecated: Function split() is deprecated in /home/dxmenu/public_html/data/support/rqfunc.php on line 13

Deprecated: Function split() is deprecated in /home/dxmenu/public_html/data/support/rqfunc.php on line 13

Deprecated: Function split() is deprecated in /home/dxmenu/public_html/data/support/rqfunc.php on line 13

Deprecated: Function split() is deprecated in /home/dxmenu/public_html/data/support/rqfunc.php on line 13

Deprecated: Function split() is deprecated in /home/dxmenu/public_html/data/support/rqfunc.php on line 13

Deprecated: Function split() is deprecated in /home/dxmenu/public_html/data/support/rqfunc.php on line 13

Deprecated: Function split() is deprecated in /home/dxmenu/public_html/data/support/rqfunc.php on line 13

Deprecated: Function split() is deprecated in /home/dxmenu/public_html/data/support/rqfunc.php on line 13

Deprecated: Function split() is deprecated in /home/dxmenu/public_html/data/support/rqfunc.php on line 13

Deprecated: Function split() is deprecated in /home/dxmenu/public_html/data/support/rqfunc.php on line 13

Deprecated: Function split() is deprecated in /home/dxmenu/public_html/data/support/rqfunc.php on line 13

Deprecated: Function split() is deprecated in /home/dxmenu/public_html/data/support/rqfunc.php on line 13
How Can I Hide My Dropdown Menu On Print?
 
(c) 2016, Deluxe-Menu.com
Search  
Ctrl+F2 - enter/switch menu | Arrow keys - navigate | Esc - exit menu  
  Support
  FAQ
  Contacts
  About Us
  Recent Questions


 

    How can I hide my dropdown menu on print?

Return to Recent Questions


Q: Can I use javascript to get the object (getElementByID). If not how do I hide my dropdown menu on print?

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();">
...
</body>
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 menu when your customers push "File/Print" you should write so:
You must create two functions, for example:

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

And then you must write so:

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





Return to Recent Questions

Best 18 Landing Page Bootstrap Theme Roundup Bootstrap Alert Colors  |  Bootstrap Table Template  |  Bootstrap Buttons Group  |  Bootstrap Pagination Responsive  |  Top Mindblowing HTML Image Slideshow Ideas  | 
Copyright (c) 2016, Deluxe-Menu.com
Home  |  Product Info  |  Samples  |  Download  |  Purchase  |  FAQ  |  Site Map  |  Terms of Use  |  Write Us
All rights reserved. it | static website generator | best website design software | bootstrap button | free bootstrap templates