jquery section
<script type= "Text/javascript" >$ (document). Ready (function () {$ ("#owl-demolpo"). Owlcarousel ({items:4, Navigation:true, Navigationtext: ["", ""], DataType: ' Jsonp ', Jsonp: ' Jsonpcallback ', JsonPath: ' Your JSON data page/aaa.php ', jsonsuccess:customdatasuccess}); </script><script type= "Text/javascript" > Function customdatasuccess (huodong) {var Sc Hooldetail = "; for (var j = 0; J < Huodong.length; J + +) {var imgurl=huodong[j].photourl; Schooldetail + = ' <div class= ' yijj item ' > ' + ' <p class= ' p1 ' > </p> ' + ' <p class= "P2" ><a href= "' +huodong[j].activityur L + ' > ' +huodong[j].activityname+ ' </a></p> ' + ' </div> '; } $ ("#owl-demolpo"). HTML (schooldetail); }</script>
JSON data page
[{"Activityname":"free diagnosis of midterm papers","Activityurl":"http://wenzhangurl.cn/huodong/123","Photourl":"Http://images.cn/upload/2017/10/25/20171025171830-8852e6be.png"},{"Activityname":"Volunteer Lecture for college entrance examination","Activityurl":"/ httpwenzhangurl.cn/96","Photourl":"Http://images.cn/upload/2017/10/26/20171026101927-8be273c1.png"}]
HTML section
<div id="owl-demolpo"class="Owl-carousel Rementuijian"> </div>
Finish effect
Reference page: http://demo.lanrenzhijia.com/2013/pic1201/demos/customJson.html
Owl-carousel jquery to fetch data loops