473,402 Members | 2,046 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

image swap + restore + set

Hi all

I'm looking for a solution that can be used in a calendar/gig guide
scenario where each day is represented by a dot image. Now this dot must
do the following

1. When the mouse goes over the dot image it swaps to the mouseover dot
2. When the mouse goes out of the dot image it restores back to the
original img
3. When the img is clicked the dot image is swapped with another image
(different to the other 2) that will remain there even when the mouse
goes out of the image

I've been searching high & low for an answer but with no luck

Any gurus out there able to help ???

Cheers

Matthew
Jul 23 '05 #1
2 1861
"Matthew" <di******@hotmail.com> wrote in message
news:42********@duster.adelaide.on.net...
Hi all

I'm looking for a solution that can be used in a calendar/gig guide
scenario where each day is represented by a dot image. Now this dot must
do the following

1. When the mouse goes over the dot image it swaps to the mouseover dot
2. When the mouse goes out of the dot image it restores back to the
original img
3. When the img is clicked the dot image is swapped with another image
(different to the other 2) that will remain there even when the mouse goes
out of the image

I've been searching high & low for an answer but with no luck

Any gurus out there able to help ???


Try googling "javascript rollover" or "javascript image rollover"

Jul 23 '05 #2
Matthew wrote:
Hi all

I'm looking for a solution that can be used in a calendar/gig guide
scenario where each day is represented by a dot image. Now this dot must do the following

1. When the mouse goes over the dot image it swaps to the mouseover dot 2. When the mouse goes out of the dot image it restores back to the
original img
3. When the img is clicked the dot image is swapped with another image (different to the other 2) that will remain there even when the mouse goes out of the image

I've been searching high & low for an answer but with no luck

Any gurus out there able to help ???

Cheers

Matthew


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<base href="http://snaught.com/JimsCoolIcons/Marbles-W/">
<style type="text/css">

table {
width: 400px;
margin: 100px auto;
border-collapse: collapse;
border: 3px #fff inset;
}
td {
font: bold 11px tahoma;
border: 1px #000 solid;
background: #fafffa;
}

</style>
<script type="text/javascript">

//:::::::::::::::::::::::::::::::
var overurl = 'green-glass.jpg';
var outurl = 'green.jpg';
var clickurl = 'red-glass.jpg';
//:::::::::::::::::::::::::::::::

function init()
{

function over()
{
if (!/red/.test(this.src))
this.src = this.src.replace(outurl, overurl);
}
function out()
{
if (!/red/.test(this.src))
this.src = this.src.replace(overurl, outurl);
}
function click()
{
this.src = clickurl;
}

var i = 0,
img,
imgs = document.getElementsByTagName('img');
while (img = imgs.item(i++))
if (img.className == 'swap')
{
img.onmouseover = over;
img.onmouseout = out;
img.onclick = click;
}
var plover = new Image().src = 'green-glass.jpg';
var plclick = new Image().src = 'red-glass.jpg';
}

window.onload = function()
{
if (document.getElementsByTagName)
init();
}

</script>
</head>
<body>
<table cellspacing="1">
<tbody>
<script type="text/javascript">
document.write('<tr>');
var d = 0;
while (d < 31)
{
if (d && d % 7 == 0)
document.write('</tr><tr>');
document.write('<td><img class="swap" src="green.jpg">',++d,'</td>');
}
document.write('<td></td><td></td><td></td>');
</script>
</tbody>
</table>
</body>
</html>

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John | last post by:
I am rotating images of different dimensions. My problem is that when a new image is displayed in a new position which had an image of a different dimension, the old image is first stretched to the...
2
by: Cynthia | last post by:
I'm looking for javascript code that when I mouse over a menu item will display a picture elsewhere on the page. I know it exists, but the ones I've found so far just swap out the menu item in...
2
by: Frank Bishop | last post by:
I have been trying to do image swaps and my second image does not show up, it just goes to a blank image on the mouseover. I have Windows XP SP2 and it prompts me to allow blocked content when the...
2
by: broms10 | last post by:
I need help. I have a little button that says "next" below a big image, letīs call it "image1", when I press the button I want to swap the big image to "image2". And then if I press it again I...
12
by: Charlie King | last post by:
As I understand it, the use of FIR* to replace heading tags with images in visually enabled CSS browsers is now frowned upon on the basis that some screen readers will *nor* read back text that is...
4
by: bridgemanusa | last post by:
Hi All: I have a very long page of html that I want to take portions and hide them in divs, then show when a link is clicked. I have the hide show part working when the link is clicked, however...
3
by: dcruncher4 | last post by:
It is possible that we may be asked to restore a production tape, say 3 yrs later. We would prefer redirect restore for that. I am documenting a process to do a redirect restore. We take...
4
by: lemat | last post by:
Hi, I use a radio button form in which users can select a color by clicking on a image. I would like this image to change to another one when it's chosen. (image with a "Chosen" Stamp in the...
2
by: smokeyd | last post by:
i am trying to create a simple image button rollover.. i have searched this forum and found a number of solutions but none seem to work. i am just trying to get the onmouseover to swap the image...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.