$(function () { $("#nav > li").hover(function () { $(this).find('.nav2').animate({ opacity: 'show', height: 'show' }, 200); }, function () { $('.nav2').stop(true, true).hide(); }); //$(function () { // var onewidth = $('.lunbo').width(); // var uld = $(".xiaolunbo"); // var imags = uld.find('img'); // for (var i = 0; i < imags.length; i++) { // imags[i].width = onewidth+1; } //}) /*导航*/ /*小轮播*/ $('.index-main-top .top-center .xxk ul li').hover(function () { $(this).addclass('xuanzhong').siblings().removeclass('xuanzhong'); var index = $('.xxk ul li').index(this); $('.xxk-main > div').eq(index).show().siblings().hide(); }) $('.index-main-top .top-right .xxk ul li').hover(function () { $(this).addclass('xuanzhong1').siblings().removeclass('xuanzhong1'); var index = $('.xxk ul li').index(this); $('.xxk-main > div').eq(index).show().siblings().hide(); }) /*选项卡*/ }) $(window).resize(function () { location.reload() }) //$(document).ready(function () { // var lunbo = $('.lunbo'), // oul = lunbo.find('ul'), // yd = lunbo.find('.xiaodian>span'), // wz = lunbo.find('.wenzi>span'), // onewidth = lunbo.width(); // console.log('yd', yd); // var timer = null; // var inow = 0; // yd.on("click", function (event) { // event.stoppropagation(); //阻止事件冒泡 // $(this).addclass("xianshi").siblings().removeclass("xianshi"); // var index = $(this).index(); // inow = index; // oul.animate({ "left": -onewidth * inow, }) // $('.wenzi > span').eq(index).show().siblings().hide(); // }) // timer = setinterval(function () { // inow++; // if (inow > yd.length - 1) { // inow = 0; // } // yd.eq(inow).trigger("click"); // },2000) //}) window.onload = function () { // 轮播选项 const options = { id: 'lb-1', // 轮播盒id speed: 600, // 轮播速度(ms) delay: 3000, // 轮播延迟(ms) direction: 'left', // 图片滑动方向 moniterkeyevent: true, // 是否监听键盘事件 monitertouchevent: true // 是否监听屏幕滑动事件 } const lb = new lb(options); lb.start(); } function getquerystring(name) { //截取url的值 var reg = new regexp('(^|&)' + name + '=([^&]*)(&|$)', 'i'); var r = window.location.search.substr(1).match(reg); if (r != null) { return unescape(r[2]); } return null; }