Wrox Programmer Forums
|
CSS Cascading Style Sheets All issues relating to Cascading Style Sheets (CSS).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the CSS Cascading Style Sheets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 13th, 2007, 06:01 PM
Authorized User
 
Join Date: Aug 2004
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Arsi
Default Hiding Footer

Hello,

I would like to know if anyone has a simple way to hide the page footer when printing. I'd like to incorporate it in the following function if possible:

<script type="text/javascript">

function removeelements(){
var removeclass="remove"
var alltags=document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==removeclass)
alltags[i].style.display="none"
}
}

function revertback(){
setTimeout("window.location.reload()",50)
}

window.onbeforeprint=removeelements
window.onafterprint=revertback

</script>

Thanks!

*******(*)*******
__________________
*******(*)*******
 
Old April 13th, 2007, 06:17 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Much simpler to use a print style sheet.

.footer { display: none }

http://www.alistapart.com/stories/goingtoprint/

--
http://yupapa.com
 
Old April 13th, 2007, 06:55 PM
Authorized User
 
Join Date: Aug 2004
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Arsi
Default

Great! Thank you! I'll try that.

*******(*)*******





Similar Threads
Thread Thread Starter Forum Replies Last Post
The footer doesn't appear Tecris BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 February 21st, 2010 05:39 PM
Footer only for last page XSLTUser XSLT 0 December 27th, 2007 04:34 PM
hiding footer. rupen Javascript How-To 4 April 12th, 2007 06:07 PM
Can't see footer Bud BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 6 August 25th, 2006 04:28 AM
header footer zaman1111 JSP Basics 0 July 28th, 2005 05:00 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.