PDA

View Full Version : slideshow problems



wahyeah10
20 Oct 2010, 02:59 AM
hello everyone, please i need help, i am kinda having a problem with the slideshow i made, when the slideshow is offline it works fine, but when it goes online, its kinda slow, that is to say that it does not shows the pictures. then when i waited again for like 15minutes the photos started coming up one by one. but some still did not come. it seems like it having problems loading the photos. please i need help
here is my javascript code.

here is my html
//
<html>
<head>
<title>CAMPUS TOUR ON CHANCELLOR'S DAY</title>
<link rel="stylesheet" href="indexslide2.css" />
<script type="text/javascript" src="indexslide2.js">
</script>
</head>
<body>
<table align="center" bgcolor="#605f64">
<tr>
<td>
<h1><img id="log" src="logo.jpg">Potrait Photo Slideshow<img id="log" src="logo.jpg"</h1>
<img height="640" width="480" src="slideshow2/slideImg0.jpg" alt="UIDB ALBUM" id="slideshow" />
<div id="imgText">&nbsp; </div>
<center>
<form action="all"/>
<form action="#">
<input type="button" id="prevLink" value="&laquo; Previous"/>
<input type="button" id="nextLink" value="Next &raquo;"/>
</form>
</center>
</td>
</tr>
</table>
</body>
</html>
//

this is my external java script
//
window.onload = initAll;

var currImg = 0;
var captionText = new Array(
"A cross section of the chairs in the dinning room of the<br/> University",
"A Faculty member leads the procession with the Mase of the<br/> University",
"Consecration at Mass",
"President delivers his key note address 1",
"President delivers his key note address 2",
"Students process to the hall",
"The Chancellor delivers a sermon during the opening mass",
"The Chancellor delivers the opening speech",
"The Chancellor of the University of Buea reads a message from<br/> the Minister of Higher Education",
"The Chancellor processes to the Church",
"The Chancellor receives the Lectionary during mass",
"The Gospel being proclaimed",
"The President of UIDB and the Rector of the Catholic University<br/> of Cameroon, Bamenda in procession for mass",
"The President shows the campus to the Chancellor and former <br/>Minister of Government",
"The President takes an oath of office to the Chancellor, <br/>Mgr. Immanuel Bushu"
)

function initAll() {
document.getElementById("imgText").innerHTML = captionText[0];
document.getElementById("prevLink").onclick = processPrevious;
document.getElementById("nextLink").onclick = processNext;

}

function processPrevious() {
newSlide(-1);
}

function processNext() {
newSlide(1);
}

function newSlide(direction) {
var imgCt = captionText.length;

currImg = currImg + direction;
if (currImg < 0) {
currImg = imgCt-1;
}
if (currImg == imgCt) {
currImg = 0;
}

document.getElementById("slideshow").src = "slideshow2/slideImg" +
currImg + ".jpg";
document.getElementById("imgText").innerHTML = captionText[currImg];

}
//

Magic Toolbox
24 Oct 2010, 06:52 AM
You basically need to start with a JavaScript that already works the way you want it. If you try to fix a script that doesn't work now, it will take longer to find out what the problem is and fix it.

Magic Slideshow is HTML, XHTML and CSS compliant. It works on iPhones and iPads. It has a lot of popular options: http://www.magictoolbox.com/magicslideshow/

Also use the W3C validator to check that your HTML code is correct:

http://validator.w3.org/

Looking at your code, there is a missing close tag >. You should change this:


<h1><img id="log" src="logo.jpg">Potrait Photo Slideshow<img id="log" src="logo.jpg"</h1>

To this:


<h1><img id="log" src="logo.jpg">Potrait Photo Slideshow<img id="log" src="logo.jpg"></h1>

If you don't see the difference, it is the > towards the end of the line.

You also have two <form> tags and only one </form> tag.