JSON动态获取图片切换代码
jQuery左右滑动轮播图,使用json数据动态获取图片切换
JavaScript Code
- <script type="text/javascript">
- $(function(){
- $.getJSON("JSON/data.js",function (result){
- var setting = {
- subject:'Movie',
- cardw : 145, //page card's width .
- cardh : 145,
- cardn : 5, //the number of visible page card .
- margin : 9, //margin between cards .
- JSON :result
- };
- $('#movie').slider(setting);
- });
- $.getJSON("JSON/data.js",function (result){
- var setting = {
- subject:'images',
- cardw : 145, //page card's width .
- cardh : 145,
- cardn : 7, //the number of visible page card .
- margin : 9, //margin between cards .
- JSON :result
- };
- $('#nba').slider(setting);
- });
- });
- </script>
原文地址:http://www.freejs.net/article_jquerytupiantexiao_664.html