$(document).ready(function () { $("#favorites").click(function () {//$里面是链接的id var ctrl = (navigator.userAgent.toLowerCase()).indexOf('mac') != -1 ? 'Command/Cmd' : 'CTRL'; if (document.all) { window.external.addFavorite('http://www.jsgc.com', '1818vip威尼斯下载登录') } else if (window.sidebar) { window.sidebar.addPanel('百度', 'http://www.jsgc.com', "") } else {//添加收藏的快捷键 alert('添加失败\n您可以尝试通过快捷键' + ctrl + ' + D 加入到收藏夹~') } }) }); $(document).ready(function () { $("#wechat").mouseover(function () { $("#ewm").fadeIn(1000); //可以自己修改速度 }); $("#wechat").mouseout(function () { $("#ewm").fadeOut(100); }); }); $(function(){ $(document).on('click','.btn-hero ',function(){ var url = $(this).data('video'); console.log(url); $('body').addClass('modal-open'); $('#video').attr('src',url); $('.modal-video').show(); }); $(document).on('click','.modal-close',function(){ $('body').removeClass('modal-open'); $('#video').attr('src',''); $('.modal-video').hide(); }) }) // function search() { // var keyword = $('#keyword').val(); // location.href = "product-search.aspx?keyword=" + keyword; // return false; // }