•
•
•
•
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
![]() |
•
•
Join Date: Oct 2006
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
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
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
•
•
Join Date: Oct 2006
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
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
[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.
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]
[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]
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Printing using Web Control Print button. (ASP.NET)
- Forms - Print Button (HTML and CSS)
- Forms - Print Button (HTML and CSS)
- Help in printing mulitple documents using print button (Java)
- Strange paw print button among IE6's buttons (Web Browsers)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Resizing text fields
- Next Thread: having problem with some chars to display



Linear Mode