JavaScript Forum JS Made Easy: Free JavaScripts Tutorials Example Code
About This Product
FontsMadeEasy.com
 
The Business Internet
Find it on This page:
 
| Over 5000 Free Fonts | Tutorials | Javascript Forum | Other Javascript Resources | Cheat Sheet

     
Jsmadeeasy Forums Home   Search   Login   Register   Member List  
JS Made Easy  > JavaScript programming  > Re:  
 
Display using:  
Previous Thread :: Next Thread 
 Author Thread: Print image only
dacrack is not online. Last active: 7/28/2004 3:52:08 PM dacrack
Joined: 28 Jul 2004
Total Posts: 1
 
Print image only
Posted: 21 May 2002 03:09 AM
Hi there,

i have several websites with variable pictures on it.
I want to make a button which ONLY print the shown picture not the text etx around it.

ps. the shown pictures are randomized so i can't say "print xxx.jpg" it is always another name.....

qsaaiman is not online. Last active: 5/30/2006 4:23:08 AM qsaaiman
Top 25 Poster
Joined: 28 Jul 2004
Total Posts: 21
 
Re:
Posted: 21 May 2002 06:14 AM
I don't know exaztly know how your page loox but I have 2 suggestions.

1: Make a popup window with the pic & then print it.

2: (this is what I would do)

<script language="JavaScript">
function print_pic() {
div1.style.display = "none"
div2.style.display = "none"
window.print()
div1.style.display = ""
div2.style.display = ""
}
</script>

<div id="div1" style="display:">
Top part of the site.
</div>
The pic here.
<div id="div2" style="display:">
Bottom part of the site.
</div>

if that can't be done I can probly figure something out for you, but then I will need a better idea of what you want.

HTH

Regards

Quintin Saaiman
Department of Labour
IT Systems

Quintin Saaiman
ggallen is not online. Last active: 7/28/2004 3:52:08 PM ggallen
Top 25 Poster
Joined: 28 Jul 2004
Total Posts: 4
 
Re:
Posted: 24 May 2002 12:43 PM
I did something similar. Instead what I did
was put the text in a table, then set the
style.visibility to "hidden" did my print()
then reset style.visibility to "".

George

Previous Thread :: Next Thread 
Goto to page:  Prev Next
 
Jsmadeeasy.com  > JS Made Easy  > JavaScript programming  > Re: