Click to See Complete Forum and Search --> : novice desperately seeking some expert help!!!


scripto
03-28-2003, 10:31 AM
Can anyone help me?? Ive been trying out this code for days now (novice to script) and presumed it would be a straightforward copy and paste, replacing with my own images. All i want it to do is show two pictures at same time when user hovers mouse over the link. One being a jpg, the other a small gif. Ive made sure my images fit the heights and widths in the code. So far i just cant seem to get it right, images will not appear, show as white box with red cross. Please please please can anyone help??? i would be extremely grateful. If u go to www.lesletytestpage.0catch.com u will see it as appears from the below code. Many thanks pps :)

<div ID="idPicture1" style="position: absolute; top: 155; left: 235; width: 629; height: 420">
<!-- TWO STEPS TO INSTALL CHANGE TWO IMAGES:


<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<!-- Picture Gallery Script #1 -->

<head>
<script LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
var dtext = new Image();
var dlarge = new Image();
var stext = new Image();
var slarge = new Image();
var ttext = new Image();
var tlarge = new Image();

var atext = new Image();
var alarge = new Image();
var btext = new Image();
var blarge = new Image();
var ctext = new Image();
var clarge = new Image();


dtext.src = "arctxtjs.gif";
dlarge.src = "swedepicjs.jpg";
stext.src = "luvvatxt2js.gif";
slarge.src = "scotlandjs.jpg";
ttext.src = "queentxtjs.jpg";
tlarge.src = "queenpicjs.jpg";

atext.src = "sweettxtjs.jpg";
alarge.src = "longislandjs.jpg";
btext.src = "luvvatxt2js.gif";
blarge.src = "liverpicjs.jpg";
ctext.src = "luvvatxt2js.gif";
clarge.src = "southajs.jpg";


function doButtons(textimage, picimage) {
document['text'].src=textimage;
document['picture'].src=picimage;
}
// End -->
</script>
</head>

<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<body link="#66CCFF" vlink="#FFFFFF" alink="#0000FF" style="position: absolute">

</div>
<div ID="idPicture2" style="position: absolute; top: 157; left: 162; width: 609; height: 304">
<center>
<table border="1" width="479" height="329">
<tr>
<td width="240" height="473"><center>
<h2><font color="#FFFFFF">Members:</font></h2>
</center>
<li><img border="0" src="newglobe.gif" width="40" height="40"><a href="http://www..com/Arctic.html" onmouseover="doButtons('arctxtjs.gif', 'swedepicjs.jpg')" onmouseout="doButtons('blank.gif', 'blank.gif')">Arctic</a><p>&nbsp;&nbsp;
<img border="0" src="newglobe.gif" width="40" height="40"><a onmouseover="doButtons('luvvatxt2js.gif', 'scotlandjs.jpg')" onmouseout="doButtons('blank.gif', 'blank.gif')" href="http://www..com/Luvva.html">Luvva</a></p>
<p>&nbsp; <img border="0" src="newglobe.gif" width="40" height="40"><a onmouseover="doButtons('queentxtjs.jpg', 'queenpicjs.jpg')" onmouseout="doButtons('blank.gif', 'blank.gif')" href="http://www..com/Queenofalllll.html">Queenofalllll</a></p>
<p></p>
<p>&nbsp; <img border="0" src="newglobe.gif" width="40" height="40"><a onmouseover="doButtons('sweettxtjs.jpg', 'longislandjs.jpg')" onmouseout="doButtons('blank.gif', 'blank.gif')" href="http://www..com/Sweetdream.html">SweetDream</a></p>
<p>&nbsp;&nbsp; <img border="0" src="newglobe.gif" width="40" height="40"><a href="http://www..com/MandyAngel.html" onmouseover="doButtons('luvvatxt2js.gif', 'liverpicjs.jpg')" onmouseout="doButtons('blank.gif', 'blank.gif')">MandyAngel</a></p>
<p>&nbsp; <img border="0" src="newglobe.gif" width="40" height="40"><a onmouseover="doButtons('luvvatxt2js.gif', 'southajs.jpg')" onmouseout="doButtons('blank.gif', 'blank.gif')" href="http://www./Spice1.html">Spice1</a></p>
<p><img name="text" src="blank.gif" width="240" height="50" border="0"></a></li>
</td>
<td width="375" height="473">
<img name="picture" src="blank.gif" width="373" height="358" border="0"></td>
</tr>
</table>
</center>

DaiWelsh
03-28-2003, 10:51 AM
Firstly you have an extra t in the middle of your url so it does not work.

On to the question; well, for one thing, the images in question are not present on the server e.g.

http://www.lesleytestpage.0catch.com/html/newglobe.gif

simply is not there, so naturally it will show up. Perhaps you have it in a different directory in which case you need to change the path of the image src.

HTH,

Dai

scripto
03-28-2003, 11:34 AM
LOL - ok forgive my typo
My name is Lesley, not leslety

images are on server, in assets folder.....even in preview mode, before publish, nada, no images load, received one rror that says "doucment.text = null or is not an object" when the script fails

khalidali63
03-28-2003, 11:37 AM
Try this link

http://68.145.35.86/skills/javascripts/DisplayTwoImagesOnMouseOver.html

Cheers

Khalid

DaiWelsh
03-30-2003, 08:19 AM
scripto, if the images are in the 'assets' folder then you need to point to them in the assets folder, at the moment the paths are all for image sint he same folder as the html page.