AshleyQuick
09-18-2007, 02:05 AM
Hi!
Any way to modify this so that when you click on the existing image, it changes to the second but then automatically reverts back to the existing image after a few seconds?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
div {
text-align:center;
}
#pic{
border:none;
}
</style>
<script type="text/javascript">
var c=0;
window.onload=function() {
document.getElementById('pic').onclick=function() {
swapImage();
}
}
function swapImage() {
obj=document.getElementById('pic');
if(c==1) {
obj.src='/art/logo_paypal_buy.gif';
c=0;
}
else {
obj.src='/art/logo.gif';
c=1;
}
}
</script>
</head>
<body>
<div>
<img id="pic" src="/art/logo_paypal_buy.gif" alt="PayPal"/>
</div>
</body>
</html>
Any way to modify this so that when you click on the existing image, it changes to the second but then automatically reverts back to the existing image after a few seconds?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
div {
text-align:center;
}
#pic{
border:none;
}
</style>
<script type="text/javascript">
var c=0;
window.onload=function() {
document.getElementById('pic').onclick=function() {
swapImage();
}
}
function swapImage() {
obj=document.getElementById('pic');
if(c==1) {
obj.src='/art/logo_paypal_buy.gif';
c=0;
}
else {
obj.src='/art/logo.gif';
c=1;
}
}
</script>
</head>
<body>
<div>
<img id="pic" src="/art/logo_paypal_buy.gif" alt="PayPal"/>
</div>
</body>
</html>