<!DOCTYPE html>
<html>
<head>
<title>mobileselec移动端模似select滑动选择插件用法</title>
<link rel="stylesheet" type="text/css" href="css/mobileSelect.css">
<script type="text/javascript" src="js/jquery-3-3.1.min.js"></script>
<script type="text/javascript" src="js/mobileSelect.js"></script>
</head>
<body>
<div id="trigger2">点我有意外</div>
</body>
</script>
<script type="text/javascript">
var mobileSelect2 = new MobileSelect({
trigger: '#trigger2',
title: '地区选择',
wheels: [{data:[
{id:'1',value:'附近'},
{id:'2',value:'上城区'},
{id:'3',value:'下城区'},
{id:'4',value:'江干区'},
{id:'5',value:'拱墅区'},
{id:'6',value:'西湖区'}
]},
{data:[
{id:'1',value:'1000米'},
{id:'2',value:'2000米'},
{id:'3',value:'3000米'},
{id:'4',value:'5000米'},
{id:'5',value:'10000米'}
]}
],
callback:function(indexArr, data){
console.log(data); //返回选中的json数据
}
});
</script>
</html>
网友评论