开发者

How to add file name in array from xml file in javascript while implementing Google Slideshow

开发者 https://www.devze.com 2022-12-21 09:18 出处:网络
I am trying to implement SlideShow of google in my site www.tapasya.c开发者_如何学编程o.in. You can see it on home page. The problem is that i m not being able to add images dynamically such that it c

I am trying to implement SlideShow of google in my site www.tapasya.c开发者_如何学编程o.in. You can see it on home page. The problem is that i m not being able to add images dynamically such that it can take all the images automatically from folder that i m specifying.

Currently i have to add each nd every image in javascripts data array.

Is it their a way so that i need not add images to this array.

 <script type="text/javascript">  
 //<![CDATA[
   window.addEvent('domready', function(){
     var data = {
       '1.jpg': { caption: 'Volcano Asención in Ometepe, Nicaragua.' }, 
       '2.jpg': { caption: 'A Ceibu tree.' }, 
       '3.jpg': { caption: 'The view from Volcano Maderas.' }, 
       '4.jpg': { caption: 'Beer and ice cream.' }
     };
     var myShow = new Slideshow.KenBurns('show', data, {captions: false, controller: false, delay: 5000, duration: 10000, height: 200, hu: '../Scripts/SlideShow/images/', thumbnails: false, width: 990, linked: true});
          var box = new Lightbox({ 
          'onClose': function(){ this.pause(false); }.bind(myShow), 
          'onOpen': function(){ this.pause(true); }.bind(myShow) 
       });

   });
 //]]>
 </script>

Is it their any way so that it can read the file name, caption and hyperrefrence if any from xml file


Yes, you should be able to do it. I'm not a Mootools expert, but it does have some AJAX functions built in. The documentation for them is here: http://mootools.net/docs/core/Request/Request So, try reading though the docs to get an idea of what it can do. But basuically, you should be able to change your 'data' variable to be the return value from onr of the AJAX request functions. Good luck.

0

精彩评论

暂无评论...
验证码 换一张
取 消