/    Sign up×
Community /Pin to ProfileBookmark

Printer friendly version in new window

Hi there, this is my first post on this forum. I hope somebody can help…
I am using style switcher to provide alternative accessible styles for my website one of which is a printer friendly version. I want to be able to have this printer friendly version pop up in a new window. I have tried using the following script:

<a href=”#” onClick=”myRef = window.open(”+self.location,’mywin’,
‘left=20,top=20,width=800,height=800,toolbar=1,resizable=1’);
myRef.focus(); setActiveStyleSheet(‘print’);return false; “>New Window </a>

…This indeed pops up the print version in a new window but it also changes the style of the main window. How can I have it so the print version is in the popup only and the main window keeps its default styling?

Thanks in advance,

Simon

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@chrysMay 25.2005 — Hi there, this is my first post on this forum. I hope somebody can help...

I am using style switcher to provide alternative accessible styles for my website one of which is a printer friendly version. I want to be able to have this printer friendly version pop up in a new window. I have tried using the following script:

<a href="#" onClick="myRef = window.open(''+self.location,'mywin',

'left=20,top=20,width=800,height=800,toolbar=1,resizable=1');

myRef.focus(); setActiveStyleSheet('print');return false; ">New Window </a>

...This indeed pops up the print version in a new window but it also changes the style of the main window. How can I have it so the print version is in the popup only and the main window keeps its default styling?

Thanks in advance,

Simon[/QUOTE]


Simon,

It seems like you are changing the active stylesheet when you click... you need to change the stylesheet of the new window you've opened. You are changing it int he main window (if my assumption about your setstylesheet function is right)
Copy linkTweet thisAlerts:
@simonjcauthorMay 25.2005 — Thanks Chrys,

Yes, that is what is haoppening. The idea is to cange the active stylesheet for the popup window only. How do I achive this but leave the main window unchanged?

S.
×

Success!

Help @simonjc spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...