'use strict'; var $nav2_li = $('.nav2_hover>li'), step = $nav2_li.width(), time = 300, resizetimeout, $win = $(window), $body = $('body'), $html = $('html,body'), plateindex = 0, pagename = ['首页', ''][$('.nav_ul>li.active').index()], pagerealyname = ['', '', '', '_xindihao', '_rs', '_ev'][$('.nav_ul>li.active').index()], $mask = $('.mask'); // dealer_xindihao.txt var winwidth = $win.width(), winheight = $win.height(), maxheight, $dialog = $('.dialog'); //导航 var $nav_ul2 = $('.nav_ul2'), $nav_li2 = $('.nav_ul2>li'), $points = $('.points'), nav_li2_index = 0, $section = $('section'), scrollarr = []; function init() { var l1 = 0, l2 = 0, step = 9, data1 = [], data2 = [], $con = $('.content'), sindex = 1; // tweenmax.set($('.rightbtn3')[0],{scalex:-1,scaley:-1}); var $car_href = $('.car_href'); if(l1 > l2) { $car_href.eq(0).removeclass('hide'); $car_href.eq(1).addclass('hide'); $con.eq(0).removeclass('hide'); $con.eq(1).addclass('hide'); } else { $car_href.eq(1).removeclass('hide'); $car_href.eq(0).addclass('hide'); $con.eq(1).removeclass('hide'); $con.eq(0).addclass('hide'); } //$('.news').height($('.news').height()); gets(); scrollm(); if(scrolltop + winheight === maxheight) { canmove2 = true; } // $('.bigevent').height(winheight); maxheight = $body.height(); $years.eq(0).css('top', '50%'); $.each($points, function(i) { $(this).css('left', step * i); }); var $pdspan = $('.pd>span'); if(sindex === 1) { $pdspan.eq(1).removeclass('active'); $pdspan.eq(0).addclass('active'); $con.eq(0).removeclass('hide'); $con.eq(1).addclass('hide'); $car_href.eq(0).removeclass('hide'); $car_href.eq(1).addclass('hide'); } else { $pdspan.eq(0).removeclass('active'); $pdspan.eq(1).addclass('active'); $con.eq(1).removeclass('hide'); $con.eq(0).addclass('hide'); $car_href.eq(1).removeclass('hide'); $car_href.eq(0).addclass('hide'); } } function gets() { scrollarr = []; $.each($section, function(i) { scrollarr.push(math.floor($(this).offset().top - 40) >> 0); }); scrollarr[scrollarr.length - 1] += 40; scrollarr[0] = 0; if(winheight < 600) { scrollarr[2] += 40; } } $nav_ul2.on('mousewheel', function(e) { e.preventdefault(); }); $nav_li2.on('click', function() { nav_li2_index = $(this).index(); $nav_ul2.eq(0).children().eq(nav_li2_index).addclass('active').siblings().removeclass('active'); $nav_ul2.eq(1).children().eq(nav_li2_index).addclass('active').siblings().removeclass('active'); canmove = false; canmove2 = false; $html.stop(true).animate({ "scrolltop": scrollarr[nav_li2_index] }, 800, "easeoutcubic", function() { canmove = true; canmove2 = true; }); }); //亮点板块 (function() { var $move_div = $('.move_div'), $move_img = $move_div.children(), $points_li = $('.points>li'), $img1 = $('.img1'), $img2 = $('.img2'), $plate_divs = $('.plate>div'), platelength = $plate_divs.length, nav2_pre = 0, nav2_index = 0, platepreindex = 0, canplay = true, platearr = [0]; (function() { var i = 0, l = $points.length, i2 = 0; for(; i < l; i++) { i2 += $points.eq(i).children().length; platearr.push(i2); } platearr.pop(); })(); function toplate() { if(!canplay) { return; } canplay = false; if(plateindex === platepreindex) { canplay = true; return; } else if(platepreindex < plateindex) { tweenmax.fromto($mask.eq(platepreindex)[0], 1.2, { x: 0 }, { x: -winwidth }); tweenmax.fromto($mask.eq(plateindex)[0], 1.2, { x: winwidth }, { x: 0, oncomplete: function() { canplay = true; } }); tweenmax.fromto($plate_divs.eq(platepreindex)[0], 0.8, { x: '0%' }, { x: '-100%' }); tweenmax.fromto($plate_divs.eq(plateindex)[0], 0.8, { x: '100%' }, { x: '0%' }); } else { tweenmax.fromto($mask.eq(platepreindex)[0], 1, { x: 0 }, { x: winwidth }); tweenmax.fromto($mask.eq(plateindex)[0], 1, { x: -winwidth }, { x: 0 }); tweenmax.fromto($plate_divs.eq(platepreindex)[0], 0.8, { x: '0%' }, { x: '100%' }); tweenmax.fromto($plate_divs.eq(plateindex)[0], 0.8, { x: '-100%' }, { x: '0%', oncomplete: function() { canplay = true; } }); } $points_li.eq(platepreindex).removeclass('active'); $points_li.eq(plateindex).addclass('active'); platepreindex = plateindex; var l = platearr.length; while(l--) { if(plateindex >= platearr[l]) { break; } } nav2_index = l; if(nav2_pre === nav2_index) { return; } $points.eq(nav2_pre).addclass('hide'); $points.eq(nav2_index).removeclass('hide'); $img1.eq(nav2_pre).removeclass('hide'); $img2.eq(nav2_pre).addclass('hide'); $move_div.stop(true).animate({ left: step * nav2_index }, time, function() { $img1.eq(nav2_index).addclass('hide'); $img2.eq(nav2_index).removeclass('hide'); }); nav2_pre = nav2_index; } $('.left').on('click', function() { plateindex--; if(plateindex < 0) { plateindex = 0; return; } toplate(); }); $('.right').on('click', function() { plateindex++; if(plateindex === platelength) { plateindex = platelength - 1; return; } toplate(); }); $points_li.on('click', function() { var i = $(this).index(), i2 = $points.index($(this).parent()); plateindex = platearr[i2] + i; toplate(); }); var pagenames = { '战斧': ['美学向上', '操控向上', '舒适向上', '安全向上', '科技向上'] } $nav2_li.on({ click: function() { var i = $(this).index(); plateindex = platearr[i]; toplate(); }, mouseenter: function() { var i = $(this).index(), i2 = nav2_index; if(i === i2) { return; } $img1.eq(i2).removeclass('hide'); $img2.eq(i2).addclass('hide'); $move_div.stop(true).animate({ left: step * i }, time, function() { $img1.eq(i).addclass('hide'); $img2.eq(i).removeclass('hide'); }); }, mouseleave: function() { var i = $(this).index(), i2 = nav2_index; if(i === i2) { return; } $img1.eq(i).removeclass('hide'); $img2.eq(i).addclass('hide'); $move_div.stop(true).animate({ left: step * i2 }, time, function() { $img1.eq(i2).addclass('hide'); $img2.eq(i2).removeclass('hide'); }); } }); $.each($plate_divs, function(i) { if(i !== plateindex) { tweenmax.set(this, { x: '100%' }); } else { tweenmax.set(this, { x: '0%' }); } }); $.each($mask, function(i) { if(i !== plateindex) { tweenmax.set(this, { x: winwidth }); } else { tweenmax.set(this, { x: 0 }); } }); })(); //360+配置表 (function() { var point2index = 0, point2pre = 0, $points2li = $('.points2>li'), $rect = $('.angle360'), $carsimg = $('.cars>img'), $move = $('.move'), movearr = [], colorindex = 0, $cars = $('.cars'), $carcolor = $('.carcolor>li'); if($carcolor.length) { $carsimg = $cars.eq(colorindex).find('img'); $carcolor.on('click', function() { var i = $(this).index(); if(i === colorindex) { return; } $carcolor.eq(colorindex).removeclass('active'); $cars.eq(colorindex).addclass('hide'); colorindex = i; $carcolor.eq(colorindex).addclass('active'); $cars.eq(colorindex).removeclass('hide'); $carsimg = $cars.eq(colorindex).find('img'); $carsimg.addclass('hide'); $carsimg.eq(point2index).removeclass('hide'); }); $('.leftbtn3').on('click', function() { point2index++; if(point2index === len) { point2index = 0; } $carsimg.addclass('hide'); $carsimg.eq(point2index).removeclass('hide'); }); $('.rightbtn3').on('click', function() { point2index--; if(point2index < 0) { point2index = len - 1; } $carsimg.addclass('hide'); $carsimg.eq(point2index).removeclass('hide'); }); var rx, ry, mx, my, ex, ey, isdown = false, step2 = 50, len = $carsimg.length; $rect.on({ mousedown: function(e) { isdown = true; rx = e.pagex; ry = e.pagey; }, mousemove: function(e) { if(isdown) { mx = e.pagex; my = e.pagey; if(mx - rx > step2) { rx = mx; point2index++; if(point2index === len) { point2index = 0; } $carsimg.addclass('hide'); $carsimg.eq(point2index).removeclass('hide'); } else if(mx - rx < -step2) { rx = mx; point2index--; if(point2index < 0) { point2index = len - 1; } $carsimg.addclass('hide'); $carsimg.eq(point2index).removeclass('hide'); } } return false; }, mouseup: function(e) { isdown = false; ex = e.pagex; ey = e.pagey; } }); } else { $points2li.on('click', function() { point2index = $(this).index(); if(point2pre === point2index) { return; } $move.css('left', movearr[point2index]); $carsimg.eq(point2pre).addclass('hide'); $carsimg.eq(point2index).removeclass('hide'); point2pre = point2index; }); $('.leftbtn3').on('click', function() { point2index++; if(point2index === len) { point2index = 0; } $move.css('left', movearr[point2index]); $carsimg.eq(point2pre).addclass('hide'); $carsimg.eq(point2index).removeclass('hide'); point2pre = point2index; }); $('.rightbtn3').on('click', function() { point2index--; if(point2index < 0) { point2index = len - 1; } $move.css('left', movearr[point2index]); $carsimg.eq(point2pre).addclass('hide'); $carsimg.eq(point2index).removeclass('hide'); point2pre = point2index; }); movearr.push($points2li.eq(0).position.left); $.each($points2li, function() { movearr.push($(this).position().left); }); movearr.pop(); var rx, ry, mx, my, ex, ey, isdown = false, step2 = 50, len = $points2li.length; $rect.on({ mousedown: function(e) { isdown = true; rx = e.pagex; ry = e.pagey; }, mousemove: function(e) { if(isdown) { mx = e.pagex; my = e.pagey; if(mx - rx > step2) { rx = mx; point2index++; if(point2index === len) { point2index = 0; } $move.css('left', movearr[point2index]); $carsimg.eq(point2pre).addclass('hide'); $carsimg.eq(point2index).removeclass('hide'); point2pre = point2index; } else if(mx - rx < -step2) { rx = mx; point2index--; if(point2index < 0) { point2index = len - 1; } $move.css('left', movearr[point2index]); $carsimg.eq(point2pre).addclass('hide'); $carsimg.eq(point2index).removeclass('hide'); point2pre = point2index; } } return false; }, mouseup: function(e) { isdown = false; ex = e.pagex; ey = e.pagey; } }); } //弹出的配置表 var $same = $('.same'), $same2 = $('.same2'), $t2 = $('.t2'), $tdspan = $('.td2>span'), $table2 = $('.table2'), $tdh1 = $('.tdh1'), t2maxh, sameclick = false, tdh1arr = [], canmove3 = true; $('.look').on('click', function() { $dialog.removeclass('hide2'); $('.peitable').removeclass('hide'); $('.peitable').children().removeclass('hide'); t2maxh = ($table2.height() - $t2.height()) >> 0; tdh1arr = []; $.each($tdh1, function(i) { tdh1arr.push($(this).position().top >> 0); }); }); $('.down').on('click', function() { }); $tdspan.on('click', function() { canmove3 = false; $(this).addclass('active').siblings().removeclass('active'); $t2.stop(true).animate({ scrolltop: tdh1arr[$(this).index()] }, 300, function() { canmove3 = true; }); }); $('.samebtn').on('click', function() { if(sameclick) { $same.children().addclass('hide'); $same2.removeclass('hide'); } else { $same.children().removeclass('hide'); $same2.addclass('hide'); } sameclick = !sameclick; t2maxh = ($table2.height() - $t2.height()) >> 0; tdh1arr = []; $.each($tdh1, function(i) { tdh1arr.push($(this).position().top >> 0); }); var t = $t2.scrolltop() >> 0, l = tdh1arr.length; if(t !== t2maxh) { while(l--) { if(t >= tdh1arr[l]) { break; } } } else { l--; } $tdspan.eq(l).addclass('active').siblings().removeclass('active'); }); $dialog.on('mousewheel', function(e) { return false; }); $t2.on('scroll', function() { if(!canmove3) { return false; } var t = $t2.scrolltop() >> 0, l = tdh1arr.length; if(t !== t2maxh) { while(l--) { if(t >= tdh1arr[l]) { break; } } } else { l--; } $tdspan.eq(l).addclass('active').siblings().removeclass('active'); }); $t2.on('mousewheel', function(e, d) { e.stoppropagation(); if(!canmove3) { return false; } var t = $t2.scrolltop() >> 0; if(d > 0) { if(t === 0) { return false; } } else { if(t === t2maxh) { return false; } } }); })(); //精彩体验 (function() { var $jcimgs = $('.jcimgs>img'), jcnext = $('.jcnext')[0], $avideo = $('.avideo'), $v = $('.v'); tweenmax.set(jcnext, { x: '100%' }); $('.jc_play>img').on('click', function() { $(this).addclass('active').siblings().removeclass('active'); //alert($(this).closest('.jc').html()); $jcimgs=$(this).closest('.jc').find('.jcimgs>img'); $jcimgs.eq($(this).index()).fadein(500).siblings().fadeout(400); }); $('.jc_right').on('click', function() { $(this).addclass('hide'); tweenmax.to(jcnext, 0.8, { x: '0%' }); }); $('.jc_left').on('click', function() { tweenmax.to(jcnext, 0.8, { x: '100%', oncomplete: function() { $('.jc_right').removeclass('hide'); } }); }); $('.jc_videos>div').on('click', function() { var src = $(this).attr('data-src'); if(src) { $dialog.removeclass('hide2'); $avideo.removeclass('hide'); $v.html(''); } }); $('.close').on('click', function() { $dialog.addclass('hide2'); $(this).parent().addclass('hide'); }); $('.vclose').on('click', function() { $v.html(''); }); var $jc_play = $('.jc_play'), $jc_left_btn = $('.jc_left_btn'), $jc_right_btn = $('.jc_right_btn'), step = 216, index = 0, maxindex = $jc_play.children().length - 4; function top() { $jc_play.stop(true).animate({ 'left': -index * step }, 300); if(index === 0) { $jc_left_btn.addclass('disabled'); } else if(index === 1) { $jc_left_btn.removeclass('disabled'); } if(index === maxindex) { $jc_right_btn.addclass('disabled'); } else if(index === maxindex - 1) { $jc_right_btn.removeclass('disabled'); } } $jc_left_btn.on('click', function() { if(index === 0) { return; } index--; top(); }); $jc_right_btn.on('click', function() { if(index === maxindex) { return; } index++; top(); }); })(); //大事记 var eventsdom = $('.events')[0], $years = $('.years>img'), $ey = $('.ey'), $event = $('.event'), eventsmaxy = $event.eq(-1).position().top + 500 - winheight, curstate = 1, prestate = 1, evindex = 0, evlength = $ey.length, canmove = true, canmove2 = false, scrolltop, $car_nav2 = $('.car_nav2'), headerh = $('.header').outerheight(), yearpre = 0, $back = $('.back'), eyarr = (function() { var arr = []; $.each($ey, function(i) { arr.push($(this).position().top); }); return arr; })(), movenum, $bar3_b = $('.bar3_b'), $span_year = $('.span_year'), bar3_length = $bar3_b.length; (function() { $span_year.on('click', function() { movenum = $span_year.index(this); var pre = evindex; if(pre === movenum) { return; } tweenmax.set($event, { y: 0 }); $.each($bar3_b, function(i) { if(i > movenum) { $(this).removeclass('active'); } else { $(this).addclass('active'); } }); if(movenum === bar3_length - 2) { $bar3_b.eq(bar3_length - 1).addclass('active'); } if(pre > movenum) { var c = $ey.eq(pre).children().eq(0), t = (c.position().top + c.height() + 200) >> 0; tweenmax.to($ey.eq(pre)[0], 0.8, { y: t, oncomplete: function() { $ey.eq(pre).addclass('hide'); } }); evindex = movenum; $ey.eq(evindex).removeclass('hide'); tweenmax.fromto($ey.eq(evindex)[0], 0.8, { y: '-100%' }, { y: '0%' }); $years.eq(pre).css('opacity', 0); $years.eq(evindex).css('opacity', 1); tweenmax.fromto($years.eq(evindex), 0.5, { top: '-150%' }, { top: '50%' }); yearpre = evindex; } else { var c = $ey.eq(pre).children().eq(-1), t = (c.position().top + c.height() + 100) >> 0; tweenmax.to($ey.eq(pre)[0], 0.8, { y: -t, oncomplete: function() { $ey.eq(pre).addclass('hide'); } }); evindex = movenum; $ey.eq(evindex).removeclass('hide'); tweenmax.fromto($ey.eq(evindex)[0], 0.8, { y: '100%' }, { y: '0%' }); $years.eq(pre).css('opacity', 0); $years.eq(evindex).css('opacity', 1); tweenmax.fromto($years.eq(evindex), 0.5, { top: '150%' }, { top: '50%' }); yearpre = evindex; } }); })(); function scrollm() { scrolltop = $win.scrolltop() >> 0; if(scrolltop >= headerh) { curstate = 2; } else { curstate = 1; } //alert(prestate);alert(curstate); if(prestate !== curstate) { if(curstate === 1) { $car_nav2.eq(0).removeclass('hide'); $car_nav2.eq(1).addclass('hide'); } else { $car_nav2.eq(1).removeclass('hide'); $car_nav2.eq(0).addclass('hide'); } prestate = curstate; } var l = scrollarr.length; while(l--) { if(scrolltop >= scrollarr[l]) { break; } } if(l < 0) { l = 0; } if(l === scrollarr.length - 1) { $back.removeclass('hide2'); } else { $back.addclass('hide2'); } if(canmove) { $nav_ul2.eq(0).children().eq(l).addclass('active').siblings().removeclass('active'); $nav_ul2.eq(1).children().eq(l).addclass('active').siblings().removeclass('active'); } if(scrolltop + winheight >= maxheight) { canmove2 = true; } else { canmove2 = false; } } $('.back').on('click', function() { canmove2 = false; canmove = false; $nav_ul2.eq(0).children().eq(0).addclass('active').siblings().removeclass('active'); $nav_ul2.eq(1).children().eq(0).addclass('active').siblings().removeclass('active'); $html.stop(true).animate({ "scrolltop": 0 }, 800, "easeoutcubic", function() { canmove2 = true; canmove = true; }); }); /* //大记事滚动 var windowsscrollheight=$(document).height(); var bigeventoffsettop=0; $('.bigevent').on('mousewheel', function(e, d) { bigeventoffsettop=$ey.eq(evindex).children().eq(-1).offset().top; if(canmove2) { e.stoppropagation(); e.preventdefault(); if(d > 0) { var t = $ey.eq(evindex).children().eq(0).position().top; if(evindex === 0 && t >= 290) { canmove2 = false; return; } if(t >= winheight - 150) { var pre = yearpre; tweenmax.to($ey.eq(evindex)[0], 0.8, { y: '100%', oncomplete: function() { $ey.eq(pre).addclass('hide'); } }); evindex--; $ey.eq(evindex).removeclass('hide'); tweenmax.fromto($ey.eq(evindex)[0], 0.8, { y: '-100%' }, { y: '0%' }); $years.eq(pre).css('opacity', 0); $years.eq(evindex).css('opacity', 1); tweenmax.fromto($years.eq(evindex), 0.5, { top: '-150%' }, { top: '50%' }); yearpre = evindex; $.each($bar3_b, function(i) { if(i > evindex) { $(this).removeclass('active'); } else { $(this).addclass('active'); } }); if(evindex === bar3_length - 2) { $bar3_b.eq(bar3_length - 1).addclass('active'); } return; } $.each($ey.eq(evindex).children(), function(i) { var speed = $(this).attr('data-speed'); tweenmax.to(this, 0.5, { y: '+=' + (200) * speed }); }); } else { //if($ey.eq(evindex).children().eq(-1).offset().top <= winheight * 6) { //alert(windowsscrollheight); alert(bigeventoffsettop); if(windowsscrollheight - bigeventoffsettop - 400 >= winheight / 6) { if(evindex === evlength - 1) { return; } var pre = yearpre; tweenmax.to($ey.eq(pre)[0], 0.8, { y: '-100%', oncomplete: function() { $ey.eq(pre).addclass('hide'); } }); evindex++; $ey.eq(evindex).removeclass('hide'); tweenmax.fromto($ey.eq(evindex)[0], 0.8, { y: '100%' }, { y: '0%' }); $years.eq(pre).css('opacity', 0); $years.eq(evindex).css('opacity', 1); tweenmax.fromto($years.eq(evindex), 0.5, { top: '150%' }, { top: '50%' }); yearpre = evindex; $.each($bar3_b, function(i) { if(i > evindex) { $(this).removeclass('active'); } else { $(this).addclass('active'); } }); if(evindex === bar3_length - 2) { $bar3_b.eq(bar3_length - 1).addclass('active'); } return; } $.each($ey.eq(evindex).children(), function(i) { var speed = $(this).attr('data-speed'); tweenmax.to(this, 0.5, { y: '-=' + (200) * speed }); }); } } });*/ $win.on('resize', function() { cleartimeout(resizetimeout); resizetimeout = settimeout(function() { winwidth = $win.width() winheight = $win.height(); headerh = $('.header').outerheight(); // $('.bigevent').height(winheight); maxheight = $body.height(); eventsmaxy = $event.eq(-1).position().top + 500 - winheight; gets(); scrollm(); $.each($mask, function(i) { if(i !== plateindex) { tweenmax.set(this, { x: winwidth }); } else { tweenmax.set(this, { x: 0 }); } }); }, 100); }); $win.on('scroll', function(e) { scrollm(); }); $win.on('mousewheel', function(e, d) { /*if (!canmove || canmove2) { return false; }*/ /*if (d > 0) { $html.stop(true).animate({ "scrolltop": "-=300px" }, 600, "easeoutcubic", function() { }); } else { $html.stop(true).animate({ "scrolltop": "+=300px" }, 600, "easeoutcubic", function() { }); } return false;*/ }); (function() { //轮播 var playpre = 0, playindex = 0, $play = $('.index_play').children(), $index_num = $('.index_num'), playlength = $play.length, timeout; if(playlength === 0) { return; } $index_num.text((playindex + 1) + '/' + playlength); function preplay() { playindex--; if(playindex < 0) { playindex = playlength - 1; } toplay(1); } function nextplay() { playindex++; if(playindex === playlength) { playindex = 0; } toplay(2); } function toplay(num) { $index_num.text((playindex + 1) + '/' + playlength); if(num === 2) { tweenmax.fromto($play.eq(playpre), 0.5, { x: '0%' }, { x: '-100%' }); $play.eq(playindex).removeclass('hide'); tweenmax.fromto($play.eq(playindex), 0.5, { x: '100%' }, { x: '0%', oncomplete: function() { clearinterval(timeout); timeout = settimeout(function() { nextplay(); }, 4000); } }); playpre = playindex; } else { tweenmax.fromto($play.eq(playpre), 0.5, { x: '0%' }, { x: '100%' }); $play.eq(playindex).removeclass('hide'); tweenmax.fromto($play.eq(playindex), 0.5, { x: '-100%' }, { x: '0%', oncomplete: function() { clearinterval(timeout); timeout = settimeout(function() { nextplay(); }, 4000); } }); playpre = playindex; } } $('.index_left_btn').on('click', function() { clearinterval(timeout); preplay(); }); $('.index_right_btn').on('click', function() { clearinterval(timeout); nextplay(); }); timeout = settimeout(function() { nextplay(); }, 4000); })(); init(); //新闻 /*(function() { var $pdspan = $('.pd>span'), $car_href = $('.car_href'), $content = $('.content'); $pdspan.on('click', function() { var i = $(this).index(); $car_href.eq(i).removeclass('hide').siblings('.car_href').addclass('hide'); $content.eq(i).removeclass('hide').siblings('.content').addclass('hide'); $(this).addclass('active').siblings().removeclass('active'); }); })();*/ //视频播放 //获取视频地址 function getvideourl(url){ var playerstr=' '; return playerstr; } //弹窗 function showpop(html){ var popwinstr='
'+html+'
'; //alert(popwinstr); $(".popwin").html(popwinstr); $(".popwin").removeclass("hide"); //alert("show") } $(".popwin").on('click','.closex',function(){ $(".popwin").html(""); $(".popwin").addclass("hide"); }) //弹出视频 var $btnvideo = $('#btnvideo'); $btnvideo.on('click', function(e) { e.preventdefault(); //alert($btnvideo.attr("data-video")); showpop(getvideourl($btnvideo.attr("data-video"))); });