function clickVideo(selector){ var video = document.getElementById('video'); selector.on('click',function(){ $('.video-fixed').stop(true,true).removeClass('ons').hide(); $('.video-fixed').fadeIn().delay(500).addClass('ons'); // video.play(); $("html,body").addClass('on-foxed') var videoSrc = $(this).attr('data-swf'); $('#video').fadeIn(500).attr('src',videoSrc); }) $('.video-fixed .cha').on('click',function(){ $('.video-fixed').removeClass('ons').delay(500).fadeOut(); // video.pause(); $("html,body").removeClass('on-foxed') $('#video').fadeOut(500).attr('src',""); }) $(".video-fixed").on("click",function(){ $('.video-fixed').removeClass('ons').delay(500).fadeOut(); $("html,body").removeClass('on-foxed') $('#video').fadeOut(500).attr('src',""); }) $(".video-fixed .videoboxs").on("click",function(e){ e.stopPropagation() }) } function getUrlParam(name){ var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r!=null) return unescape(r[2]); return null; }