navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Use Javascript to display

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> Cascading Style Sheets >> Use Javascript to display
Page: [1]
 
lu lu

 

Posts: 418
From: wpg, mb
Status: offline

 
Use Javascript to display - 9/25/2003 20:16:46   
Is there a way to use a Javascript function to determin the text to pint in CCS? This is what I have so far, please help:

<html>
<head>
<script language="JavaScript"><!--
function text1(){
....
}
function text2(){
....
}
function text3(){
....
}
// --></script>

<head>
        <style type="text/css">
            #print_text1 {
                display:none;
            }

            @media print {
                #print_invisible {
                    display:none;
                }
                #print_text1 {
                    display:block;
                }
            }
            #print_text2 {
                display:none;
            }

            @media print {
                #print_invisible {
                    display:none;
                }
                #print_text2 {
                    display:block;
                }
            }
            #print_text3 {
                display:none;
            }

            @media print {
                #print_invisible {
                    display:none;
                }
                #print_text3 {
                    display:block;
                }
            }
        </style>
</head>
<body>
        <span id="href='text1.html'">
Page displayed here      
        </span>
</body>

lu lu

 

Posts: 418
From: wpg, mb
Status: offline

 
RE: Use Javascript to display - 9/26/2003 13:00:37   
Maybe there is another way to do this. This is my situation:

I'm using a flash file that has buttons which calls another swf into the original swf on a differnet level, to display a scroller containg text. I have a printer friendly buttons in the swfs that prints external .txt files, 1 .txt file for each called swf, which is the same text that each scroller contains. I'm trying to make thing more user frienld by incorporating the IE browser print button into the senerio. Because I have an external .txt file for each piece of text in each scroller, and because I want to target each .txt file to print via the browser button, I thought maybe when a JS function is initiated from inside Flash, I could somehow use the onbeforeprint handler to select the appropiate .txt file to print. Depending on which JS function was initiated from inside the swf, the .txt file containing the same text as the swf scroller would print.

So basically I trying to print the .txt file accociated with the swf scroller by using the IE browser print button, hence the onbeforeprint handler : http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/events/onbeforeprint.asp

I'll think I'll need to use CSS to print the text file and I think I'll either need to populate the CSS with the correct .txt file when the IE browser print button is fired and the JS handler initiated.

Any thoughts on this???

The above code on the previous post is what i have so far. maybe i'm going about this the wrong way?

(in reply to lu lu)
lu lu

 

Posts: 418
From: wpg, mb
Status: offline

 
RE: Use Javascript to display - 9/26/2003 15:50:36   
Well I found some Great articles:

http://www.alistapart.com/stories/goingtoprint/

http://www.dynamicdrive.com/dynamic.../printstyle.htm

So my question now becomes: "So how would I use the onbeforeprint handler to dynamically populate the link tag to print the correct .txt file(href="printerfriendly.txt") from a called JS function?"

< Message edited by lu lu -- 9/26/2003 4:00:43 PM >

(in reply to lu lu)
Page:   [1]

All Forums >> Web Development >> Cascading Style Sheets >> Use Javascript to display
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts