2013-11-20 58 views
0

這是(部分)網頁。出於某種原因,我無法進行幻燈片放映操作。你能幫我解決嗎?如何創建dojo 1.9幻燈片

<!DOCTYPE html> 
<html> 
    <head lang='fr'> 
    <meta http-equiv='content-type' content='text/html;charset=ISO-8859-1' /> 
    <link href='../dojo-release-1.9.1/dijit/themes/claro/claro.css' rel='stylesheet' type='text/css' media='all' /> 
    </head> 
    <body class='claro'> 
    <script> 
    dojoConfig = {async: true, parseOnLoad: true} 
    </script> 
    <script type='text/javascript' src='../dojo-release-1.9.1/dojo/dojo.js'> 
     </script> 
    <script type='text/javascript'> 
    require(["dojo", "dojo/parser", "dojo/store/Memory", "dojox/image/SlideShow"]); 
    var imageData= { 
     identifier: "imageUrl", 
     items: [ 
       { imageUrl: "http://mysyte.net/photos/f1.jpg"}, 
       { imageUrl: "http://mysyte.net/photos/f2.jpg"}, 
       { imageUrl: "http://mysyte.net/photos/f3.jpg"}, 
       { imageUrl: "http://mysyte.net/photos/f4.jpg"} 
      ] 
    };    
    </script> 
    <div data-dojo-type='dojo/store/Memory' data-dojo-props='data:imageData' data-dojo-id='imageStore'></div> 
    <div data-dojo-type='dojox/image/SlideShow' id='slideshow1' data-dojo-id='imageShow' 
     data-dojo-props='store: imageStore, noLink: true, autoStart:true, imageWidth:770, imageHeight:345, slideshowInterval: 5'> 
    </div> 
</body> 
</html> 

我在想什麼?你能幫我修理嗎?謝謝!

+0

你得到的錯誤是什麼? –

+0

沒有錯誤,但沒有任何反應。我可以在Firebug中看到元素在那裏,因爲當鼠標懸停在該區域上時不透明度會發生變化。但就是這樣,沒有圖像顯示。如果你可以訪問Apache服務器(或者WAMP,LAMP),你可以嘗試一下嗎?我可以給我的測試網站提供一個鏈接,但我不確定是否允許。它本質上是相同的。 –

回答

0

問題已解決。

<!DOCTYPE html> 
<html> 
    <head lang='fr'> 
    <meta http-equiv='content-type' content='text/html;charset=ISO-8859-1' /> 
    <link href='../dojo-release-1.9.1/dijit/themes/claro/claro.css' rel='stylesheet' type='text/css' media='all' /> 
    </head> 
    <body class='claro'> 
    <script> 
    dojoConfig = {async: true, parseOnLoad: true} 
    </script> 
    <script type='text/javascript' src='../dojo-release-1.9.1/dojo/dojo.js'></script> 
    <script type='text/javascript'> 
    var imageData= { 
     identifier: "imageUrl", 
     items: [ 
       { imageUrl: "http://mysyte.net/photos/f1.jpg"}, 
       { imageUrl: "http://mysyte.net/photos/f2.jpg"}, 
       { imageUrl: "http://mysyte.net/photos/f3.jpg"}, 
       { imageUrl: "http://mysyte.net/photos/f4.jpg"} 
      ] 
    }; 
    require(["dojo", "dojo/data/ItemFileReadStore", "dojox/image/SlideShow", "dijit/registry"], function(dojo, ItemFileReadStore, SlideShow, registry) { 
      dojo.ready(function() { 
       registry.byId('slideshow1').setDataStore(imageStore, {}) 
      }) 
     }); 
    </script> 
    <div data-dojo-type='dojo/data/ItemFileReadStore' data-dojo-props='data:imageData' data-dojo-id='imageStore'></div> 
    <div data-dojo-type='dojox/image/SlideShow' id='slideshow1' data-dojo-id='imageShow' 
     data-dojo-props='autoStart:true, showTitle: false, noLink: true, hasNav: false, imageWidth:770, imageHeight:345, fixedHeight: true, slideshowInterval: 5'> 
    </div> 
</body> 
</html> 

顯然,dojo中的SlideShow對象有一些錯誤/不一致。我甚至不得不修改dojox/image/SlideShow.js文件。我在這裏找到的線索:http://petergragert.info/dojo/demo/PKHG_won_22feb.htmlhttp://dojo-toolkit.33424.n3.nabble.com/Dojo-1-8-SlideShow-Problem-tp3991064.html