$(function () { $('#fullpage').fullpage({ navigation: true, afterload: function (anchorlink, index) { if (index == 1) { var val = 0; var t1 = setinterval(function () { val += 2; $("#zichan").html(val) if (val == 200) { clearinterval(t1) } }, 20) var val2 = 0; var t2 = setinterval(function () { val2 += 2; $("#chanzhi").html(val2) if (val == 100) { clearinterval(t2) } }, 20) }else{ $("#chanzhi").html(0) $("#zichan").html(0) } } }); // 鼠标经过 var old = $(".active-menu"); console.log(old) $(".menus").mouseenter(function () { $(".active-menu").removeclass('active-menu'); $(this).addclass('active-menu') $(this).find(".menus-son").stop().slidedown(300) }) $(".menus").mouseleave(function () { $(".active-menu").removeclass('active-menu'); old.addclass('active-menu') $(this).find(".menus-son").stop().slideup(300) }) // 子菜单鼠标滑过 $(".menus-son-list").mouseenter(function () { $(".lines-menu-zg").stop().animate({ width: '0px' }, 200) $(this).find(".lines-menu-zg").stop().animate({ width: '60px' }, 200) }) // 子菜单点击 $(".menus-son-list a").click(function () { old = $(this).parents('.menus') }) // // 侧面子菜单 // oldsonmenu = $(".second-menu-actived"); // $(".list-type-lists-zg a").click(function () { // $(".second-menu-actived").removeclass('second-menu-actived') // $(this).parent().addclass("second-menu-actived") // oldsonmenu = $(this).parent() // }) // $(".zg-logo-h").click(function(){ // location.href = "../index.html" // }) // 新闻轮播 var len = 0; var t = moves(len) $(".new-info-title").hover(function () { clearinterval(t); }, function () { len = $(this).index('.new-info-title') t = moves(len) }) $(".news-info-desc").hover(function () { clearinterval(t); }, function () { len = $(this).index('.news-info-desc') t = moves(len) }) function moves(len) { return setinterval(function () { len++; if (len >= $(".news-list").length) { len = 0; $(".news-img-window").animate({ marginleft: -len * 360 + "px" }, 0) $(".news-list-window").animate({ margintop: -len * 245 + "px" }, 0) } else { $(".news-img-window").animate({ marginleft: -len * 360 + "px" }, 300) $(".news-list-window").animate({ margintop: -len * 245 + "px" }, 300) } }, 3000) } })