Previous Message
Next Message

textarea and printing

Sent by diego nunes on 23 September 2005 17:05


var textareasp=[];
function convertToPrint() { var i, n, tTs, nE;
  tTs=gETN('textarea');
  for(n=tTs.length, i=0; i<n; i++) {
    nE=cE('p', '', 'textareabox', tTs.value);
    tTs.parentNode.insertBefore(nE, tTs); nE.from=tTs;
    textareasp.push(tTs); tTs.style.display='none';
  }
}
function convertBack() { var i, n, tTa;
  for (n=textareasp.length, i=0; i<n; i++) { tTa=textareasp[i];
    if (!tTa.from) { continue; }
    tTa.style.display=''; tTa.parentNode.removeChild(tTa.from);
  }
}
adEvento(window, 'beforeprint', convertToPrint);
adEvento(window, 'afterprint', convertBack);


    Unfortunately, only IE supports "beforeprint" and "afterprint"
events... You can, anyway, use a "Print Page" link, to make the
chances, trigger the self.print(); and then undo the mess :)

  Amplexos.

On 23/09/05, Brian Cummiskey [EMAIL-REMOVED]> wrote:
> Josue Martinez wrote:
> > Brian, have you used a different style sheet specifically for printed
> > material (print/css)?
>
> yes.  i have a main.css for media = screen and a print.css for media=print
>
>
>
> > On 9/23/05, Julie Angarone [EMAIL-REMOVED]> wrote:
> >>I have done this - in the css for Print media I simply set the div that
> >>scrolls to not have overflow in it - see my site:
> >>https://webdb.princeton.edu/dbtoolbox/query.asp?qname=scadmembers
>
> This won't work for me.  I'm dealing with the actual
> <textarea></textarea> form element, not a scrolling div.
>
> diego nunes wrote:
>  >     Using only CSS I don't know how to achieve it, but it's very easy
>  > with JavaScript, if you can use...
>
> I can use javascript so long as its cross-browser (firefox/ie 6 on pc)
> and doesn't involve any onload() type functions (as i already have a
> huge onload and the page rendering is already suffering because of this
> on my machine with 512mb of ram)
>
>
> Thanks for the advice so far guys.
>
> ______________________________________________________________________
> css-discuss [EMAIL-REMOVED]]
> http://www.css-discuss.org/mailman/listinfo/css-d
> List wiki/FAQ -- http://css-discuss.incutio.com/
> Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
>


--
~~ ~
diego nunes
web engineer
~ ~~
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: