var myswiper = new swiper ('.ms-vue-awesome-swiper', { //图片新闻 loop: true, // 循环模式选项 autoplay : { delay:3000 }, // 如果需要前进后退按钮 navigation: { nextel: '.swiper-button-next', prevel: '.swiper-button-prev', }, }) // banner图 var swiper = new swiper(".dsbanner .el-carousel__container", { direction: "vertical", autoplay : { delay:3000 },pagination: { el: ".dsbanner .el-carousel__indicators", clickable: true, } }); // banner图 var swiper = new swiper(".zlbanner .el-carousel__container", { direction: "vertical", autoplay : { delay:3000 },pagination: { el: ".zlbanner .el-carousel__indicators", clickable: true, } }); // 切换 // arg1--点击的对象 如li // arg2--切换的对象 // event--方法,点击(click)或者(mouseover) function tabtoggle(arg1, arg2, event,classname) { $(arg1).on(event, function() { var index = $(this).index() $(this).addclass(classname).siblings().removeclass(classname) $(arg2).eq(index).show().siblings().hide() // $(arg2).eq(index).addclass('active').removeclass('dis').siblings().addclass('dis').removeclass('active') }) } // tabtoggle($(".yqlj_tab>div"),$(".yqlj_box>div"),"mouseover","is-active"); $(function(){ _zyyw('#zyyw',8); }); //中央要闻 function _zyyw(zyyw,num){ if ($(zyyw).length > 0) { $.ajax({ url: '//www.gov.cn/pushinfo/v150203/pushinfo.jsonp', datatype: "jsonp", jsonpcallback: "pushinfojsonpcallback", success: function (data) { var html = ''; $.each(data, function (i, json) { if (i < num) { html += '
'+ '· '+json.title+'' + ''+json.pubdate.substring(0,10)+''+ '
'; } }); $(zyyw).html(html); }, error: function (e) { console.log(e) } }); } }