User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 425,928 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,689 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 3309 | Replies: 3
Reply
Join Date: Oct 2006
Posts: 2
Reputation: hasleweb is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
hasleweb hasleweb is offline Offline
Newbie Poster

Help Print button using rollover images

  #1  
Oct 19th, 2006
Hi All,
First post here - so high hopes!

I have created a rollover button that I want to use as a print button in DW MX but when I add Javascript print button code it doesn't work on my rollover. Can it be made to work or is it not possible?

In its single image state it works fine.

Help please...
Thanks

MB
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2006
Location: India
Posts: 1,289
Reputation: vishesh is on a distinguished road 
Rep Power: 5
Solved Threads: 32
vishesh's Avatar
vishesh vishesh is offline Offline
Nearly a Posting Virtuoso

Re: Print button using rollover images

  #2  
Oct 19th, 2006
send what have you done till now i mean the code used and i will help you out or tell you where u went wrong
Reply With Quote  
Join Date: Oct 2006
Posts: 2
Reputation: hasleweb is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
hasleweb hasleweb is offline Offline
Newbie Poster

Re: Print button using rollover images

  #3  
Oct 20th, 2006
Hi, Thanks for reply - the code is:
[html]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body><input name="button" type="image" class="NavButton" id="button2" onClick="window.print();" value="Print This Page" src="Images/Strippri.gif">
</body>
</html>[/html]

But I need there to be a second image for the button so that it's a rollover which then brings up the Print dialogue box. The second file is "Images/Strippriro.gif" but no idea how to write this into the code to make it work. Any thoughts? For info, The Print code was found on the internet.
Many thanks
MB
Last edited by tgreer : Oct 20th, 2006 at 10:07 am. Reason: User ignored instructions on using code tags.
Reply With Quote  
Join Date: Oct 2006
Location: India
Posts: 1,289
Reputation: vishesh is on a distinguished road 
Rep Power: 5
Solved Threads: 32
vishesh's Avatar
vishesh vishesh is offline Offline
Nearly a Posting Virtuoso

Re: Print button using rollover images

  #4  
Oct 20th, 2006
i tried it, it didn't work, but when i changed input tag to img it worked. here's the code.
[html]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function hover(imgName, srcPath)
{
document[imgName].src = srcPath;
}
</script>
</head>
<body><img name="button" type="image" class="NavButton" id="button2" onClick="window.print();" value="Print This Page" src="image.jpg" onmouseover="hover('button', 'rolloverimage.jpg')" style="cursor: pointer">
</body>
</html>
[/html]
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 9:05 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC