473,396 Members | 1,760 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,396 software developers and data experts.

Can anyone help me?

I'm not a programmer and I don't have the time and energy to start learning
right now So I need some help.

Let's say I have made an HTML Table (consisting of three columns and six
rows). In each cell, in the first column I have put in an image (six
different ones).
In the second column I have merged all six cells into one cell and there put
in an image matching the background colour.
In the right column I have again put in six different pictures, one in each
cell.

What I now want is, when I MouseOver the first top-left picture the middle
image shall change into another as well as the top right image shall change.
When I remove the pointer from the image both the changed images shall turn
back again.

When I MouseOver the second-left picture, again the middle image shall
change as well as the second-right picture, and so on and so on.

Can anyone help me?
Jannick.


Jul 23 '05 #1
6 1081
In article <40*********************@dread12.news.tele.dk>, [Nospam]
ja**************@skolekom.dk enlightened us with...
I'm not a programmer and I don't have the time and energy to start learning
right now So I need some help.
<snip>
Can anyone help me?


How much does the job pay?
--
--
~kaeli~
Santa's helpers are subordinate clauses.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2
> How much does the job pay?

Yeah, that's a good question!
This is actually an idea I got from another web site with some
modifications. Unfortunately that site no longer excists, .
The guy (a Norwegian) who made the web site once promised me to show me how
he had done this. I don't know what happened to him. Can't get in contact
with him anymore.

It is a simple "image change" script (as far as I understand). I tried to
sit down and make it myself, but I only got the "MouseOver-image" to change.
I thought that some might have done this before and had the script lying
around somewhere.

Jannick.
Jul 23 '05 #3
J. Nielsen wrote:
<snip>
What I now want is, when I MouseOver the first top-left picture the middle
image shall change into another as well as the top right image shall change.
When I remove the pointer from the image both the changed images shall turn
back again.
When I MouseOver the second-left picture, again the middle image shall
change as well as the second-right picture, and so on and so on.


This might get you started, give the images you want to change a unique
id (and matching name). This will allow you to change their src to
display a different image.

var imgsrc = new Array();
imgsrc[1]=new Array();
imgsrc[1][0]='art_1.jpg';
imgsrc[1][1]='amber_sm_3.jpg';
imgsrc[2]=new Array();
imgsrc[2][0]='art_2.jpg';
imgsrc[2][1]='amber_sm_4.jpg';

function changepics(num) {
var bigpic=document.getElementById('bigpic');
bigpic.src=imgsrc[num][0];
var littlepic=document.getElementById('littlepic'+num) ;
littlepic.src=imgsrc[num][1];
}
</script>
</head>

<body>

<table border="1" cellspacing="1" width="861">
<tr>
<td width="149"><img border="0" src="art_1_sm.jpg" width="144"
height="110" onMouseOver="changepics(1)">&nbsp;</td>
<td width="602" rowspan="4"><img border="0" src="art_3.jpg"
width="600" height="450" name="bigpic" id="bigpic"></td>
<td width="149"><img name="littlepic1" id="littlepic1" border="0"
src="amber_sm_1.jpg" width="144" height="108">&nbsp;</td>
</tr>
<tr>
<td width="149"><img border="0" src="art_2_sm.jpg" width="144"
height="108" onMouseOver="changepics(2)">&nbsp;</td>
<td width="149"><img name="littlepic2" id="littlepic2" border="0"
src="amber_sm_2.jpg" width="144" height="108">&nbsp;</td>
</tr>
</table>

Jul 23 '05 #4
mscir wrote:
<snip>
var imgsrc = new Array();
imgsrc[1]=new Array();
imgsrc[1][0]='art_1.jpg';
imgsrc[1][1]='amber_sm_3.jpg';
imgsrc[2]=new Array();
imgsrc[2][0]='art_2.jpg';
imgsrc[2][1]='amber_sm_4.jpg';

<snip>

You really should become familiar with writing Array literals, which can
appear in array literals, producing as near to multi-dimensional arrays
as javascript gets:-

var imgsrc = [
[
'art_1.jpg',
'amber_sm_3.jpg'
],
[
'art_2.jpg',
'amber_sm_4.jpg'
]
];

Richard.
Jul 23 '05 #5
In article <40*********************@dread12.news.tele.dk>, [Nospam]
ja**************@skolekom.dk enlightened us with...

It is a simple "image change" script (as far as I understand). I tried to
sit down and make it myself, but I only got the "MouseOver-image" to change.
I thought that some might have done this before and had the script lying
around somewhere.


If all you need is the image swap function, search the archives.
There's tons.

http://groups.google.com/groups?hl=e...UTF-8&oe=UTF-8
&q=image+swap&btnG=Search&meta=group%3Dcomp.lang.j avascript

Also, dynamic drive probably has some canned ones.
http://www.dynamicdrive.com

--
--
~kaeli~
What if the Hokey Pokey IS what's it's all about?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #6
Richard Cornford wrote:
mscir wrote:
<snip>
var imgsrc = new Array();
imgsrc[1]=new Array();
imgsrc[1][0]='art_1.jpg';
imgsrc[1][1]='amber_sm_3.jpg';
imgsrc[2]=new Array();
imgsrc[2][0]='art_2.jpg';
imgsrc[2][1]='amber_sm_4.jpg';


<snip>

You really should become familiar with writing Array literals, which can
appear in array literals, producing as near to multi-dimensional arrays
as javascript gets:-

var imgsrc = [
[
'art_1.jpg',
'amber_sm_3.jpg'
],
[
'art_2.jpg',
'amber_sm_4.jpg'
]
];


Thanks Richard, that did seem inefficient.

If I wanted to use that approach and still control the 1st dimension
indexes, say to non zero-beginning, or non-consecutive numbers, is this
the most efficient way to approach it?

var imgsrc = new Array();
imgsrc[3]=['art_1.jpg','amber_sm_3.jpg'];
imgsrc[5]=['art_2.jpg','amber_sm_4.jpg'];

Mike

Jul 23 '05 #7

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

Similar topics

1
by: lawrence | last post by:
I'm trying to read up on the rfc's that govern form inputs. Much of what I'm reading is stuff I didn't know before and some of it is alarming. This one left with me questions: ...
1
by: Harag | last post by:
Hi all Classic ASP, Textpad Local "test" WebServer. IIS5 Well my MS script debugger isn't running and I can't findout why. I'm sick of it failing on me so was looking for an alternative. I...
13
by: penguin732901 | last post by:
Checking back for discussions, there was a lot of talk about 2000 being slower than 97, but not so much lately. What is the latest opinion? Anyone care to set up a poll for how many NG members...
4
by: Hai Nguyen | last post by:
I'm learning C sharp and do not like vb much. I'm creatiing a wepage using panel to test myself. I tried to use these code below, which is written in VB, and to transform them to c sharp but I got...
7
by: Skc | last post by:
Hullo Just like to check whether anyone has tried RentACoder. I intend to farm out a small job that must use C#, WinForms, ADO.Net for around US$400, but don't know whether RentACoder is...
8
by: Dgates | last post by:
Has anyone typed up an index for the O'Reilly book "C# and VB.NET Conversion?" I'm just learning C#, and often using this little book to see which VB.NET terms translate directly to some term in...
0
by: Gareth | last post by:
I cannot find a reference anywhere to anyone having done this successfully... can anyone enlighten me on how you get a SSL login page working with ASP.NET and forms authentication. I have...
2
by: Bruno Alexandre | last post by:
Hi guys, does anyone know where is the Website used in the MSDN "Lear ASP.NET 2.0 with Jeff Prosise" (http://msdn.microsoft.com/asp.net/beta2/multimedia/default.aspx) events? The website used...
5
by: tony | last post by:
I'm using PHP 5 on Win-98 command line (ie no web server involved) I'm processing a large csv file and when I loop through it I can process around 275 records per second. However at around...
169
by: JohnQ | last post by:
(The "C++ Grammer" thread in comp.lang.c++.moderated prompted this post). It would be more than a little bit nice if C++ was much "cleaner" (less complex) so that it wasn't a major world wide...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.