I have the following code from another website, its working fine there, but when I want to use it in another place I have an error about SCRIPT5009: 'swapImage' is undefined
Code:
Any Suggestion it will be appreciated.
Thanks
Code:
Code:
<img width="100%" height="100%" id="mainImage" style="border: 1px solid black; border-image: none;" alt="" src="/services/PublishingImages/Slideshow/Slide1.JPG">
<script type="text/javascript">
// <![CDATA[
var currentIndex = 1;
//*********NOTE: Set this value to the number of slides you have in the presentation.
var maxIndex = 17;
function swapImage(imageIndex) {
if (imageIndex > maxIndex) {
currentIndex = maxIndex;
return;
}
if (imageIndex < 1) {
currentIndex = 1;
return;
}
currentIndex = imageIndex;
document.getElementById("mainImage").src = '/services/PublishingImages/Slideshow/Slide' + currentIndex + '.JPG';
return;
}
</script>
Any Suggestion it will be appreciated.
Thanks
Comment