[jQuery] Re: add a print event to jquery: possible ?

2007-08-01 Thread Scott Sauyet


Alexandre Plennevaux wrote:

That's working fine, except that when printing the document, it prints the html source 
after DOM manips (more info) instead of before modification of the DOM 
(address, city, postcode information).

$('span.moreInfoLink').text('more info').cluetip();

therefore, i would have loved to be able to disable this on a print() event...


Won't print-only CSS do this more simply?

@media print {
span.moreInfoLink {
display: none;
}
}

Manipulating the DOM before and after printing might just be possible, 
but it sounds extremely heavyweight for this problem.


  -- Scott



[jQuery] Re: add a print event to jquery: possible ?

2007-08-01 Thread Brandon Aaron
This doesn't help when someone chooses print from the browser/os.

--
Brandon Aaron

On 8/1/07, Alexandre Plennevaux [EMAIL PROTECTED] wrote:

  hello friends!

 question: is it possible to catch the print event via javascript/  jquery?


 AFAIK, only IE has built-in capabilities :

 window.onbeforeprint
 window.onafterprint

 I did a quick test, and in fact it is possible to overwrite the window.print 
 function:

 window.print = function(o){alert(hi);};

 wouldn't it be possible to therefore to include a print event to jquery, 
 which overwrite the default print and allows to perform dom manips before 
 printing?

 i'm asking this because i change the content of a span element so as to only 
 show it via a cluetip.

 That's working fine, except that when printing the document, it prints the 
 html source after DOM manips (more info) instead of before modification of 
 the DOM (address, city, postcode information).

 $('span.moreInfoLink').text('more info').cluetip();

 therefore, i would have loved to be able to disable this on a print() event...





 thanks!



 Alexandre


 Ce message Envoi est certifié sans virus connu.
 Analyse effectuée par AVG.
 Version: 7.5.476 / Base de données virus: 269.11.0/929 - Date: 31/07/2007
 17:26