使用图像数组列表的simplegallary.js显示适合桌面屏幕的图像
show images fit to desktop screen using simplegallary.js of image array list
在这里,我想要显示图像阵列中的图像的javascript函数应该显示为适合桌面屏幕大小,并告诉我在哪里更正代码,请告诉我是否有其他解决方案可以用于该组件
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>
真正简单的Javascript来确定屏幕大小。
以下是您可以调用的各种功能,以获取有关屏幕大小的信息:
screen.width
screen.height
screen.availWidth
screen.availHeight
screen.colorDepth
screen.pixelDepth
因此,对您来说,您所需要做的就是将dimensions
更改为
dimensions: [screen.height, screen.width]
现在你的图像应该显示在这些维度上。
相关文章:
- 如何使用url加载程序在webpack中导入多个图像
- 从桌面读取python文件时高亮显示代码
- nodejs-expressjs上传图像并显示它们
- 使用JSP从服务器检索和显示图像
- 角度:在ng重复上切换图像
- 使用图像数组列表的simplegallary.js显示适合桌面屏幕的图像
- 如何在plnkr.co上显示桌面上的图像
- 如何检索从桌面应用程序发送到Rails API的图像
- 仅在桌面版本中加载图像
- 当我使用 CKEditor CDN 时,如何从桌面上传 CKEditor 中的图像
- 将图像从桌面拖放到浏览器,而不是通过输入进行搜索
- 将 Iframe 的源另存为桌面上的图像
- 可以't使用html5从桌面上删除图像
- 如何防止图像另存为+防止图像拖动&拖放到桌面+阻止桌面浏览器上的屏幕截图
- 在移动浏览器上传前预览图像时出现问题,在桌面浏览器上运行良好
- 桌面图像拖放上传崩溃浏览器
- Firefox允许将桌面图像文件拖拽到CKEditor中
- 试图使用getUserMedia和canvas捕获桌面图像
- 使用canvas创建桌面通知图像,只有一个图像可以从后台页面工作
- 桌面和iPad在网页上的图像宽度和高度不同