Hello all!
I'm designing a printer friendly page using the css @media type. I have also in that page a javascript menu that needs to be disabled to get a printer friendly page. How can I disable javascript using css?
Thnx!
Jalenack
07-18-2005, 10:33 AM
Well, you can't disable javascript with css..But you can get rid of the result of javascript...
You can just use display: none or visibility: hidden on the javascript generated elements, and you should be on your way.
I already tried that, my code looks something like this:
In the head section:
<style>
@media print {.noprint {display: none; visibility: hidden;}}
</style>
And in the body:
<p class="noprint">
<script language="JavaScript" src="menu.js"></script>
</p>
But it still renders the menu when printing... :confused:
Pennimus
07-18-2005, 11:03 AM
Surely -
<style>
.noprint {display: none; visibility: hidden;}
</style>
<p class="noprint">
<script language="JavaScript" src="menu.js"></script>
</p>
Is what you are looking for?
Well, I guess not...
removing the '@media print' from the style, makes the page render printer friendly on screen also...and still with menu! :(
Ah, finally figured it out!
I replaced <p class="noprint"> with <div class="noprint">
Don't know why the paragraph option doesn't work, but what the hell...the div does the job. :D
Thnx all!