Click to See Complete Forum and Search --> : Who finds the error in this script?


blixa
07-05-2005, 03:06 AM
Hello

I really would liek to have a slideshow with text, and the possibility to zoom.
The problem is, I don't no much about Javascript.
On the slideshow below should be the possibility to move over the zoom.gif (picts/zoom-1.gif) and the picture would be zoomed.
But it doesn't work.
Who could help me to solve this problem?

Ideas and alternatives are of course very much appreciated.


Thanks!

Bye4now
Blixa
--------------------------------------------------------------------------

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html><head>

<title>Image Slideshow</title>

<link rel=StyleSheet href="coolstyle.css" type="text/css" media="screen">

<script language="JavaScript" src="javascripts.js"></script>

<META HTTP-EQUIV="imagetoolbar" CONTENT="no">

<SCRIPT LANGUAGE="JavaScript">



<!-- BEGIN NO RIGHT CLICK

function noRightClick() {
if (event.button==2) {
alert('You may not right mouse click this page.')
}
}
document.onmousedown=noRightClick

// END NO RIGHT CLICK -->

var watermark = "yes" // WATERMARK YES/NO
var watermark_horz = "240" // WATERMARK POSITION
var watermark_vert = "150" // WATERMARK POSITION
var watermark_opacity = "35" // WATERMARK OPACITY
var netscape_opacity = ".35" // NETSCAPE SET 0 TO 1

if (watermark == "yes") {
document.write('<div id="watermark" style=" LEFT: ' + watermark_horz + 'px; POSITION: absolute; TOP: ' + watermark_vert + 'px; Filter: Alpha(Opacity=' + watermark_opacity + ');-moz-opacity:'+ netscape_opacity +'">')
document.write('<TABLE cellpadding="0" cellspacing="0" border="0"><tr><td>')
document.write('<img src="picts/watermark.gif"><br>')
document.write('</td></tr></table>')
document.write('</div>')
}


var SLIDE_path = '/gallery/';

var SLIDE_text = new Array();
SLIDE_text[1] = 'Text zu Bild 1';
SLIDE_text[2] = 'Text zu Bild 2';
SLIDE_text[3] = 'Text zu Bild 3';
SLIDE_text[4] = 'Text zu Bild 4';
SLIDE_text[5] = 'Text zu Bild 5';

var SLIDE_pic = new Array();
var SLIDE_load = new Array();
var SLIDE_status, SLIDE_timeout;
var SLIDE_actual = 1;
var SLIDE_speed = 3000;
var SLIDE_fade = 2;

for (i = 1; i <= SLIDE_text.length-1; i++)
{
SLIDE_pic[i] = SLIDE_path+i+'.jpg';
SLIDE_load[i] = new Image();
SLIDE_load[i].src = SLIDE_pic[i];
}
var SLIDE_count = SLIDE_pic.length-1;

function SLIDE_start()
{
document.getElementById('SLIDE_pause').disabled = true;
document.images.SLIDE_picBox.src = SLIDE_load[SLIDE_actual].src;
document.getElementById("SLIDE_textBox").innerHTML= SLIDE_text[SLIDE_actual];
}

function SLIDE_play()
{
document.getElementById('SLIDE_play').disabled = true;
document.getElementById('SLIDE_pause').disabled = false;
SLIDE_actual++;
SLIDE_slide();
SLIDE_status = 'SLIDE_play';
SLIDE_timeout = setTimeout("SLIDE_play()",SLIDE_speed);
}

function SLIDE_pause()
{
clearTimeout(SLIDE_timeout);
SLIDE_status = 'SLIDE_pause';
document.getElementById('SLIDE_pause').disabled = true;
document.getElementById('SLIDE_play').disabled = false;
}

function SLIDE_back()
{
clearTimeout(SLIDE_timeout);
SLIDE_actual--;
SLIDE_slide();
if (SLIDE_status != 'SLIDE_pause') SLIDE_timeout = setTimeout("SLIDE_play()",SLIDE_speed);
}

function SLIDE_forward()
{
clearTimeout(SLIDE_timeout);
SLIDE_actual++;
SLIDE_slide()
if (SLIDE_status != 'SLIDE_pause') SLIDE_timeout = setTimeout("SLIDE_play()",SLIDE_speed);
}


function SLIDE_slide()
{
if (SLIDE_status != 'SLIDE_pause')
{
document.getElementById('SLIDE_play').disabled = true;
document.getElementById('SLIDE_pause').disabled = false;
}
if (SLIDE_actual > (SLIDE_count)) SLIDE_actual=1;
if (SLIDE_actual < 1) SLIDE_actual = SLIDE_count;
if (document.all)
{
document.getElementById("SLIDE_textBox").style.background = "transparent";
document.images.SLIDE_picBox.style.filter="blendTrans(duration=2)";

}
document.images.SLIDE_picBox.src = SLIDE_load[SLIDE_actual].src;
if (document.getElementById) document.getElementById("SLIDE_textBox").innerHTML= SLIDE_text[SLIDE_actual];

}

function SLIDE_speeds(SLIDE_valgt)
{
SLIDE_speed = SLIDE_valgt.options[SLIDE_valgt.selectedIndex].value;
}


// -->
</script>

</script>

</head>

<body onload="SLIDE_start()">
<center>
<p>&nbsp;</p>
<p><img name="SLIDE_picBox" style="border: thin inset white"></p>
</center>
<div id="navigation" align="center" style="width:100%; position:absolute; bottom:10px; top: 400px;">
<table>
<tr>
<td id="SLIDE_textBox" align="center">&nbsp;</td>
</tr>
</table>
<br />
<table>
<tr valign="middle">
<td>
<select name="SLIDE_speeds" class="searchform" onChange="SLIDE_speeds(this)">
<option value="1000">1 second</option>
<option value="2000">2 seconds</option>
<option value="3000" selected>3 seconds</option>
<option value="5000">5 seconds</option>
<option value="8000">8 seconds</option>
</select>
&nbsp;&nbsp;&nbsp;
</td>
<td>
<button type="button" id="SLIDE_back" class="button" onclick="SLIDE_back()">&nbsp;<<&nbsp;</button>&nbsp;
<button type="button" id="SLIDE_play" class="button" onclick="SLIDE_play()">Play</button>&nbsp;
<button type="button" id="SLIDE_pause" class="button" onclick="SLIDE_pause()">Pause</button>&nbsp;
<button type="button" id="SLIDE_forward" class="button" onclick="SLIDE_forward()">&nbsp;>>&nbsp;</button>
</td>
<td>
&nbsp;&nbsp;&nbsp;
<BUTTON type="button" onclick="top.window.close();" class="button">Close window</BUTTON>
</td>
</tr>
</table>
</div>
<p>&nbsp;</p>



</body>


</html>
<!-- START ZOOM CODE -->

<script language="JavaScript">
<!--

var zoom = "yes" // SHOW ZOOM yes/no

if (zoom == "yes") {
browser_version= parseInt(navigator.appVersion);
browser_type = navigator.appName;
if (browser_type == "Microsoft Internet Explorer" && (browser_version >= 4) && (navigator.userAgent.indexOf("Windows") != -1)) {
document.write("<div id=\"ZOOM\">");
document.write("<a href=\"#\" onMouseOver=\"show.style.zoom='1.5'\" onMouseOut=\"show.style.zoom='1'\"><img src=\"picts/zoom-1.gif\" border=\"0\"></a>");
document.write("<a href=\"#\" onMouseOver=\"show.style.zoom='2.0'\" onMouseOut=\"show.style.zoom='1'\"><img src=\"picts/zoom-2.gif\" border=\"0\"></a>");
document.write("<a href=\"#\" onMouseOver=\"show.style.zoom='2.5'\" onMouseOut=\"show.style.zoom='1'\"><img src=\"picts/zoom-3.gif\" border=\"0\"></a>");
document.write("</div>");
} }
// -->
</script>

<!-- END ZOOM CODE -->