|
[插件使用]
UIScrollPicture照片显示不了。
[复制链接]
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
- <meta name="format-detection" content="tephone=no,email=no,date=no,address=no">
- <style type="text/css">
- html{ background-color: white; }
- </style>
- </head>
- <body>
- </body>
- </html>
- <script type="text/javascript" src="script/api.js"></script>
- <script type="text/javascript">
- var UIScrollPicture;
- apiready = function() {
- UIScrollPicture = api.require('UIScrollPicture');
- fnOpen();
- };
- function fnOpen() {
- UIScrollPicture.open({
- rect : {
- x : 0,
- y :50,
- w : api.winWidth,
- h : api.winHeight / 2,
- },
- data : {
- paths : ['http://jsformimages**.**/5a812100bb7c7c0767f6efcc.png', 'http://jsformimages**.**/5a81211fbb7c7c0767f6eff4.png', 'widget://res/gogd.jpg'],
- captions : ['猫', '可爱的萌宠喵星人', '西伯利亚']
- },
- styles : {
- caption : {
- height : 35,
- color : '#E0FFFF',
- size : 13,
- bgColor : '#696969',
- position : 'bottom'
- },
- indicator : {
- align : 'left',
- color : '#FFFFFF',
- activeColor : '#DA70D6'
- }
- },
- placeholderImg : 'widget://res/slide1.jpg',
- contentMode : 'scaleAspectFit',
- interval : 3,
- loop : true,
- fixed : false
- }, function(ret, err) {
- if (ret) {
- alert(JSON.stringify(ret));
- } else {
- alert(JSON.stringify(err));
- }
- });
- function fnClose() {
- UIScrollPicture.close();
- };
- function fnShow() {
- UIScrollPicture.show();
- };
- function fnHide() {
- UIScrollPicture.hide();
- };
- function fnSetCurrentIndex() {
- UIScrollPicture.setCurrentIndex({
- index : 2
- });
- };
- };
- function fnReloadData() {
- UIScrollPicture.reloadData({
- data : {
- paths : ['http://p2.so**.**/t017ccbb9391da2b4a7.jpg', 'http://p3.so**.**/t01d12e93583a86b823.jpg', 'http://p1.so**.**/t01cf5cad6fa213da81.jpg'],
- captions : ['title1', 'title2', 'title3']
- }
- });
- };
- function fnAdEventListener() {
- UIScrollPicture.addEventListener({
- name : 'scroll'
- }, function(ret, err) {
- if (ret) {
- alert(JSON.stringify( ret ));
- } else {
- alert(JSON.stringify( err ));
- }
- });
- };
- </script>
复制代码
|
|