$(function(){ // 導航 $('#jsNav').children('li').on({ mouseover: function(){ $(this).children('a').addClass('hover').next('ul').stop().slideDown('fast'); }, mouseout: function(){ $(this).children('a').removeClass('hover').next('ul').stop().slideUp('fast'); } }); $('#header .site-topbar a').on({ mouseover: function(){ $(this).addClass('on'); }, mouseout: function(){ $(this).removeClass('on'); } }); // 分享二維碼 if($('div.sp-banner')[0]) { $(document.body).append('

掃描二維碼
即刻分享到手機

'); $('#qrcode').qrcode({ width: 100, height: 100, text: window.location.href }); } }); /** * @author * * @requires jQuery * * 將form表單元素的值序列化成對象 * * @returns object */ function serializeObject(form) { var o = {}; $.each(form.serializeArray(), function(index) { if (o[this['name']]) { o[this['name']] = o[this['name']] + "," + this['value']; } else { o[this['name']] = this['value']; } }); return o; };