Its not that your snippet is not ok IT IS GREAT. and usable for another options also I think like creating a pdf from.
I use print css allot because people like to print the page especially when its info like product info. then if a website is css and you print the page like you would print a page without a print link on the page itself. the printout looks horrible it will include the menu and other stuff not styled and not needed for the info the people want.
you could use DOM to start the snippet when people try to print using the print option in there brouser or use ctrl+p or apple+p you could use "onbeforeprint" that way you could maybe run the snippet.
Dimmy
Wouldn’t using a print CSS also include the navigation links / etc, since it’s just switching out CSS files?
-
☆ A M B ☆
- 24,524 Posts
Not if you put display:none; for the containers you don’t want to print, like the div for your sidebar.
http://www.alistapart.com/articles/goingtoprint/
A button of printing, generating a specific content, is different from the appeal to a print css
... On the other hand, the media Print is still very limited in term of attributes in the standard css2 and raises full of problems!
This snippet is thus very well, without it does not seem valid xhtml. damage!
Problem has been solved, I had just made a supid mistake.
Thank you for this Great Script!
Kind regards,
Pieter
Is there a function that can be added to this to make it parse snippet code (instead of just displaying content)?
If not, then we’d need 1) a search+replace function to remove the snippet brackets and replace it with code to "hide" it (not that hard at all) and 2) something to output that no data could be printed.