|
[App引擎]
关于“scrollPicture”的使用
[复制链接]
本帖最后由 神的大周 于 2014-12-5 09:50 编辑
本人新手没事自己写写代码时遇到个 scrollPicture 问题,求高手指点下。
官方给的例子在open段中是没有 paths 这参数的,但是官方文档中有这个参数,现在我按官方的例子写了代码后,运行实现不了,加了paths参数也运行不了,不知道是怎么回事了,求高手帮忙看下。官方例子代码:
var obj = api.require('scrollPicture');
var arrayPath = new Array();
arrayPath[0] = 'widget://res/scrollPicture_01.jpg';
arrayPath[1] = 'widget://res/scrollPicture_02.jpg';
arrayPath[2] = 'http://f.hiphotos**.**/image/pic/item/4e4a20a4462309f7bdca9423710e0cf3d7cad65d.jpg';
arrayPath[3] = 'widget://res/scrollPicture_04.jpg';
arrayPath[4] = 'widget://res/scrollPicture_05.jpg';
var arrayTitle = new Array();
arrayTitle[0] = 'widget://res/scrollPicture_01.jpg';
arrayTitle[1] = 'widget://res/scrollPicture_02.jpg';
arrayTitle[2] = 'http://f.hiphotos**.**/image/pic/item/4e4a20a4462309f7bdca9423710e0cf3d7cad65d.jpg';
arrayTitle[3] = 'widget://res/scrollPicture_04.jpg';
arrayTitle[4] = 'widget://res/scrollPicture_05.jpg';
obj.open({
placeHoldImg:'widget://res/scrollPicture_placehoder.png',
subtitle:{
titles:arrayTitle
},
control:{
position:0
}
},function(ret,err){
if(ret.status){
ret.click;
}else{
ret.index;
}
});
我的代码
<!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"/>
<title>Hello APP</title>
<link rel="stylesheet" type="text/css" href="./css/api.css" />
<link rel="stylesheet" type="text/css" href="./css/common.css" />
</head>
<body>
<div>
</div>
</body>
<script type="text/javascript" src="./script/api.js"></script>
<script type="text/javascript">
apiready = function(){
var obj = api.require('scrollPicture');
var arrayPath = new Array();
arrayPath[0] = 'http://f.hiphotos**.**/image/pic/item/4e4a20a4462309f7bdca9423710e0cf3d7cad65d.jpg';
arrayPath[1] = 'http://f.hiphotos**.**/image/pic/item/4e4a20a4462309f7bdca9423710e0cf3d7cad65d.jpg';
arrayPath[2] = 'http://f.hiphotos**.**/image/pic/item/4e4a20a4462309f7bdca9423710e0cf3d7cad65d.jpg';
var arrayTitle = new Array();
arrayTitle[0] = 'http://f.hiphotos**.**/image/pic/item/4e4a20a4462309f7bdca9423710e0cf3d7cad65d.jpg';
arrayTitle[1] = 'http://f.hiphotos**.**/image/pic/item/4e4a20a4462309f7bdca9423710e0cf3d7cad65d.jpg';
arrayTitle[2] = 'http://f.hiphotos**.**/image/pic/item/4e4a20a4462309f7bdca9423710e0cf3d7cad65d.jpg';
obj.open({
paths:arrayPath,
placeHoldImg:'widget://res/scrollPicture_placehoder.png',
subtitle:{
titles:arrayTitle
},
control:{
position:0
}
},function(ret,err){
if(ret.status){
ret.click;
}else{
ret.index;
}
});
};
</script>
</html>
|
|