Hello,
I’m creating a page that has different blocks of data and i want the user to be able to click a tag and print that portion of data only.
I currently have 2 stylesheets, Index.css & Print.css
I’m not sure if i should try this another way, but i feel like i’m headed in the right direction. Using IE btw.
Something similar to this..
[code]
<head>
<link href=”Index.css” rel=”stylesheet” type=”text/css”/>
<link href=”Print.css” rel=”stylesheet” type=”text/css” media=”print”/>
<script language=”JavaScript”>
function printThis(s,d) {
var sheet = document.styleSheets[1];
sheet.addRule(s,d);
window.print();
}
</script>
</head>
<body>
<div id=”section1″><a href=”Javascript:printThis(‘body div#section2′,’display:none’)”>Print me</a>
</div>
<div id=”section2″><a href=”Javascript:printThis(‘body div#section1′,’display:none’)”>Print me</a>
</div>
</body>
I think if i get this simpler portion of code to work correctly, i could get everything else to work out. I’m just stuck. Anything i’m doing wrong?