To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
[RESOLVED] CSS way to turn off javascript menu in print style sheet?
Just when you think you're finished.......lol
I created a print style sheet for our site that doesn't display banners, icons, etc. and everything works except for not stifling the js menu, it still shows up in printview and prints.
I made this page to post here with just the js links and the 'don't print' style above it that works on everything else. Is there a way to 'turn off' this menu thru CSS? thanks as always, Kathy
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
I'm trying to think of another way to accomplish this. I suppose if you don't mind using javascript to solve this, it could be done by changing the src attribute of the script tag. I've never tried but I think it might be possible
__________________
PHP builder Online Community Manager
thanks for the thought jpnyc. I've switched over to a php menu to solve the problem today, but I'll try changing the src attribute this weekend on a dummy file.
Location: Rapid Offensive Unit "Foreign Object Damage"
Posts: 19,124
I'm thinking the problem is elsewhere (perhaps in the .js files) or at least browser-dependent, since the original code works for me in both Firefox and IE6. I also wrote the following to toggle the display property programmatically.
__________________
On two occasions I have been asked [by Members of Parliament], "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
Location: Rapid Offensive Unit "Foreign Object Damage"
Posts: 19,124
Quote:
Originally Posted by JPnyc
Still don't think that'll help. Whether it's display:none or not, the script tag will be printed to the page and it will be parsed.
Yeah, but it won't be displayed, which is what I thought the problem was (at least, it isn't displayed when I try it. Not on the screen, not in print preview, not in actual print.)
__________________
On two occasions I have been asked [by Members of Parliament], "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
First, I'd use a class rather than an id for the dontprint directive like this:
.dontprint {
display: none;
}
Because then you can re-use that in multiple places in your HTML where you'd like items that don't print.
2) Then I would put the <div class='dontprint'> directly into the javascript code (in a document.write or what have you) so that that the div gets output along with the other output that the menu js produces. So instead of wrapping your script tag with the div, you're including the div in your javascript rendering.
Hi guys, thanks for the suggestions. I had to get the site up and running so I bit the bullet and bought a really good CSS book and created the menu that way. I did save copies of my old files and these responses because I really would like to try them out, especially using the class like both you guys suggested. I'm really looking forward to taking a beginners class for programming so I can understand what I'm trying to do a bit better,
air conditioning running on March 6, this is nuts!
thanks and I'll let you know how it goes. Kathy