Click to See Complete Forum and Search --> : Can u help this newbie plz??
scripto
03-25-2003, 10:33 AM
I first tried to use javascript a few nites ago and found this site. I am trying to use the "change two images" script available here. it seems straightforward enough but when i preview my page, all i see is white boxes with red crosses. I am sure i have replaced all relevant parts with "myimages".gir/jps..but i am unsure about the following code
var dtext = new Image();
var dlarge = new Image();
var stext = new Image();
var slarge = new Image();
var ttext = new Image();
var tlarge = new Image();
Do i include my image.gif/jpgs inside the () here also? and if not, can anyone help me out with this :) Thanks
khalidali63
03-25-2003, 10:41 AM
You are creating image objects without providing a source
do this for all
var dtext = new Image();
dtext.src ="image.gif"
var dlarge = new Image();
dlarge.src ="image.gif
Cheers
Khalid
scripto
03-25-2003, 10:58 AM
Thanks Khalid,
i do have the following in the code underneath what i posted earlier...is it maybe how im trying to call the files? sowwy, i am a total newbie aint i??
dtext.src = "Arctxt.gif";
dlarge.src = "Swedepic.jpg";
stext.src = "luvvatxt2.gif";
slarge.src = "Scotland.jpg";
ttext.src = "queentxt.jpg";
tlarge.src = "queenpic.jpg";
atext.src = "sweettxt.jpg";
alarge.src = "Longisland.jpg";
btext.src = "luvvatxt2.gif";
blarge.src = "liverpic.jpg";
ctext.src = "luvvatxt2.gif";
clarge.src = "southa.jpg";
khalidali63
03-25-2003, 11:11 AM
why dont you post complete code here.
Khalid
scripto
03-25-2003, 11:27 AM
<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 = "Arctxt.gif";
dlarge.src = "Swedepic.jpg";
stext.src = "luvvatxt2.gif";
slarge.src = "Scotland.jpg";
ttext.src = "queentxt.jpg";
tlarge.src = "queenpic.jpg";
atext.src = "sweettxt.jpg";
alarge.src = "Longisland.jpg";
btext.src = "luvvatxt2.gif";
blarge.src = "liverpic.jpg";
ctext.src = "luvvatxt2.gif";
clarge.src = "southa.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./.htm" onmouseover="doButtons('Arctxt.gif', 'Swedepic.jpg')" onmouseout="doButtons('blank.gif', 'blank.gif')">Arctic</a><p>
<img border="0" src="newglobe.gif" width="40" height="40"><a onmouseover="doButtons('luvvatxt2.gif', 'Scotland.jpg')" onmouseout="doButtons('blank.gif', 'blank.gif')" href="http://www./htm">Luvva</a></p>
<p> <img border="0" src="newglobe.gif" width="40" height="40"><a onmouseover="doButtons('queentxt.jpg', 'queenpic.jpg')" onmouseout="doButtons('blank.gif', 'blank.gif')" href="http://www./htm">Queenofalllll</a></p>
<p></p>
<p> <img border="0" src="newglobe.gif" width="40" height="40"><a onmouseover="doButtons('sweettxt.jpg', 'Longisland.jpg')" onmouseout="doButtons('blank.gif', 'blank.gif')" href="http://www./htm">SweetDream</a></p>
<p> <img border="0" src="newglobe.gif" width="40" height="40"><a href="http://www./htm" onmouseover="doButtons('luvvatxt2.gif', 'liverpic.jpg')" onmouseout="doButtons('blank.gif', 'blank.gif')">MandyAngel</a></p>
<p> <img border="0" src="newglobe.gif" width="40" height="40"><a onmouseover="doButtons('luvvatxt2.gif', 'southa.jpg')" onmouseout="doButtons('blank.gif', 'blank.gif')" href="http://www./htm">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>
Thanks Khalid! for taking time on this. much appreciated
scripto
03-25-2003, 12:15 PM
Maybe this will help, this is what happens once i publish
http://www.lesleytestpage.0catch.com
Thanks once again :)