No, not really. It is IE only (more or less) but I'd like to change as little as possible in the current html layout.
Most optimal would be to just set an attribute that permanently sets the block to "invisible during print" -- some kind of equivalent to: style.display[media=print]
Is it not possible to access media "blocks" dynamically? I haven't found anything on MSDN yet...
Main Topics
Browse All Topics





by: monolith_888Posted on 2006-03-07 at 08:17:11ID: 16124670
Is this IE only? If so, you can take advantage of the onbeforeprint() and onafterprint() functionality:
/////
ame('SPAN' ); ('hide')" onafterprint="switchStuff( 'show')">
/////
///////////////////////// START //////////////////////////
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head><title>Print</title>
<script language="Javascript">
function switchStuff(status)
{
var spans = document.getElementsByTagN
for(var i=0; i<spans.length; i++)
{
if(spans[i].className == 'noprint')
spans[i].style.display = (status == 'hide') ? 'none' : 'inline';
}
}
</script>
</head>
<body onbeforeprint="switchStuff
<span id="filler"> hi </span>
<span id="filler" class='noprint'> foo </span>
<span id="filler"> bar </span>
</body>
</html>
///////////////////////// END //////////////////////////
-monoith