Hi,
Need support how to achieve addition of java script for each new document.I have converted most of my static html/css/js website to modx template. Every html page uses a custom java script which changes the images at certain interval from image folder. I want to incorporate that in modx site documents I plan to create.
I tried to include my java script in chunk called "Product1"and add that chunk [[$Product1]] in new document editor but not working.
Similarly Product2 will have different set of images so in my static website i have javascript for product 2, so when i create a new documents for product 2 i would like to call Product 2 javascript.
Here is the java script in chunk
<script language="JavaScript" type="text/javascript">
<!--
// Courtesy of SimplytheBest.net -
http://simplythebest.net/scripts/
gSlideshowInterval = 4;
gNumberOfImages = 10;
gImages = new Array(gNumberOfImages);
gImages[1] = "assets/templates/template1/images/image1.jpg";
gImages[2] = "assets/templates/template1/images/image2.jpg";
gImages[3] = "assets/templates/template1/images/image3.jpg";
gImages[4] = "assets/templates/template1/images/image4.jpg";
gImages[5] = "assets/templates/template1/images/image5.jpg";
gImages[6] = "assets/templates/template1/images/image6.jpg";
gImages[7] = "assets/templates/template1/images/image7.jpg";
gImages[8] = "assets/templates/template1/images/image8.jpg";
gImages[9] = "assets/templates/template1/images/image9.jpg";
gImages[10] = "assets/templates/template1/images/image10.jpg";
function canManipulateImages() {
if (document.images)
return true;
else
return false;
}
function loadSlide(imageURL) {
if (gImageCapableBrowser) {
document.slide.src = imageURL;
return false;
}
else {
return true;
}
}
function nextSlide() {
gCurrentImage = (gCurrentImage + 1) % gNumberOfImages;
loadSlide(gImages[gCurrentImage]);
}
gImageCapableBrowser = canManipulateImages();
gCurrentImage = 0;
setInterval("nextSlide()",gSlideshowInterval * 1000);
// -->
</script>
thnx
sintl