2

I have a page with many links. and Have a button to print, clicking on that will be print.css included. In print preview version of the page remain all the links intact.

Is there a way to disable all the link in print preview? i.e. they are no more clickable.

user160820
  • 14,866
  • 22
  • 67
  • 94

2 Answers2

2

I know this isn't disabling the links, but this is along the lines of print preview and links. Here's an option that you can add to your css so links will print much nicer: http://davidwalsh.name/optimize-your-links-for-print-using-css-show-url

Caleb Kester
  • 1,650
  • 2
  • 14
  • 16
0

I wouldn't disable the links as much as style them the same way as regular text, since the intent of clicking on Print Preview is to prepare to print the page, where the links won't work anyway.

If you're still set on disabling links, you can try this query code. Assume that your body has a class called print on it:

$("body.print a").each(function(a) { $(a).html(a.innertext); });

The above is pseduocode and was off the top of my head at 8:30 AM. I would just save yourself the trouble and make links look like surrounding text.

Derreck Dean
  • 3,708
  • 1
  • 26
  • 45