Hi!
I´m having problem with this slideshow I wanna do. I´m a beginner and don´t really know how to do, when I want to check the small pictures, and then open a bigger version of them in another page.
I could really need some help, I´m very comfused...
This is how my code looks like.
Thank you!
For us to help, it would be nice to know what the problem is that you are having
to give us a clue as to where to look. You did not include the URL where the pictures
are located so we can not see if they are displaying correctly or not. Do you have the
script on a server where we could see it in action or are you getting the picture locally?
Where did you get the script from? Did it ever work for you?
My problem is that i can´t open a bigger version of the checked pictures in another page, as a slideshow.
I need to save them in an array (or someting) and move that information to the other page.
The code for the second page looks like this.
Thanx!
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Uppgift 6</title>
<link rel="stylesheet" type="text/css" href="style6.css" />
<script type="text/javascript">
xpicBig = window.opener.xpicBig;
var showSlide;
var imgText = new Array("En fjäril.","Båtar vid stranden.","En kyrka i Spanien.","Somrig blomma.","Snart ett nytt glas.");
function initShow() {
var HTMLcode = "<select name = 'menuPic' onchange = 'showPict()'>"; // OBS!! id eller name? Gör så att när jag väljer i menyn anropas showPict 'menupic'=rullista i menyn
for (var i=0; i<xpicBig.length; i++) { //Loop för att se vilka/hur många filer som är förkryssade
var HTMLcode = HTMLcode + "<option>" + xpicBig[i] + "</option>"; //Lägger till en optiontag, för varje fil som loopen räknar upp
} // End for
var HTMLcode = HTMLcode + "</select>";
document.getElementById("menu").innerHTML = HTMLcode; //Visar var funktionen ska visas
document.showForm.menuPic.selectedIndex = 0; // första optiontaggen ska visas i menyn
showSlide = document.getElementById("ShowedPic"); //vart bilden ska visas
showSlide.src = "pics/" + xpicBig[0];
box = document.getElementsByName("textBox1")
for (var i=0; i<box.length; i++){
box[i].style.left = 5*i+"px";
}
imgText = 0;
} // End initShow
function PrevPic() {
var i = document.showForm.menu.selectedIndex; // Index för den bild som visas
if (i > 0) { // Om ej första bild redan visas
document.showForm.menu.selectedIndex = i-1; // Subtrahera 1 från menyvalet, så att menyn uppdateras
showSlide.src = "pics/" + xpicBig[i-1]; // Visa föregående bild
} // End if
} // End PrevPic
function NextPic() {
var i = document.showForm.menu.selectedIndex; // Index för den bild som visas
if (i < xpicBig.length-1) { // Om ej sista bild redan visas
document.showForm.menu.selectedIndex = i+1; // Addera 1 till menyvalet, så att menyn uppdateras
showSlide.src = "pics/" + xpicBig[i+1]; // Visa nästa bild
} // End if
} // End NextPict
function showPict(){
showSlide.src = "pics/" + xpicBig[document.showForm.menu.selectedIndex]; //Tar reda på vad jag valt i menyn
}//End showPict
function textBox(){
//var imgText = selectedIndex;
box[imgText].style.zIndex = 10;
var z = 9;
for (var i=imgText+1; i<box.length; i++){
box[i].style.zIndex = z;
}
z = 9;
for (var i=imgText+1; i<box.length; i++){
box[i].style.zIndex = z;
z = z - 1;
}
}//End textBox
</script>
</head>
<body onload="initShow()";>
<h2> Bildspel</h2>
<div id="picSlideShow" name="textBox1">
<img id="showedPic" alt="Bilderna i bildspelet." src="pics/white.jpg" onmouseover="textBox()"; />
<form name="showForm" action="">
<input type="button" value="Bakåt" onclick="prevPic()"; />
<span id="menu">här ska menyn ligga</span>
<input type="button" value="Framåt" onclick="nextPic()"; />
</form>
</div>
</body>
</html>