0

ここで、画像配列から画像を表示したいのですが、デスクトップの画面サイズに合わせてコードを修正する場所を教えてください。このコンポーネントに他の解決策があるかどうか教えてください。

     var mygallery=new simpleGallery({
            wrapperid: "slideshow", //ID of main gallery container,
            dimensions: [960, 430], //width/height of gallery in pixels. Should reflect dimensions of the images exactly
            imagearray: [
                        ["http://www.sifasusa.com/Atimo_s/news/slide-show16.jpg", "", ""],
                ["http://www.sifasusa.com/Atimo_s/news/slide-show15.jpg", "", ""],
                        ["http://www.sifasusa.com/Atimo_s/news/slide-show14.jpg", "", ""],
                        ["http://www.sifasusa.com/Atimo_s/news/slide-show01.jpg", "", ""],  
                ["http://www.sifasusa.com/Atimo_s/news/slide-show02.jpg", "", ""],
                ["http://www.sifasusa.com/Atimo_s/news/slide-show12.jpg", "", ""],
                ["http://www.sifasusa.com/Atimo_s/news/slide-show03.jpg", "", ""],
                ["http://www.sifasusa.com/Atimo_s/news/slide-show04.jpg", "", ""],
                ["http://www.sifasusa.com/Atimo_s/news/slide-show05.jpg", "", ""],
                ["http://www.sifasusa.com/Atimo_s/news/slide-show08.jpg", "", ""],
                ["http://www.sifasusa.com/Atimo_s/news/slide-show13.jpg", "", ""],
                ["http://www.sifasusa.com/Atimo_s/news/slide-show09.jpg", "", ""],
                ["http://www.sifasusa.com/Atimo_s/news/slide-show10.jpg", "", ""],
                ["http://www.sifasusa.com/Atimo_s/news/slide-show11.jpg", "", ""]
                ],
            autoplay: [true, 2500, 8], //[auto_play_boolean, delay_btw_slide_millisec, cycles_before_stopping_int]
            persist: false, //remember last viewed slide and recall within same session?
            fadeduration: 500, //transition duration (milliseconds)
            oninit:function(){ //event that fires when gallery has initialized/ ready to run
                //Keyword "this": references current gallery instance (ie: try this.navigate("play/pause"))
            },
            onslide:function(curslide, i){ //event that fires after each slide is shown
                //Keyword "this": references current gallery instance
                //curslide: returns DOM reference to current slide's DIV (ie: try alert(curslide.innerHTML)
                //i: integer reflecting current image within collection being shown (0=1st image, 1=2nd etc)
            }
                });



html code
<body>
<div id="slideshow">
    <img src="http://www.sifasusa.com/Atimo_s/news/slide-show01.jpg">
</div>

</body>
4

1 に答える 1

0

画面サイズを決定するための非常に単純な Javascript。

画面サイズに関する情報を取得するために呼び出すことができるさまざまな関数を次に示します。

screen.width
screen.height
screen.availWidth
screen.availHeight
screen.colorDepth
screen.pixelDepth

したがって、あなたがする必要があるのはdimensions

dimensions: [screen.height, screen.width]

これで、画像がそれらの寸法で表示されるはずです。

于 2014-07-07T14:58:18.683 に答える