/** * Created by lance on 2016-04-17. */ //澶勭悊缂╃暐鍥 function DrawImage(hotimg) { $(hotimg).jqthumb({ width: '100%',//瀹藉害 height: '142px',//楂樺害 //position : { y: '50%', x: '50%'},//浠庡浘鐗囩殑涓棿寮€濮嬩骇鐢熺缉鐣ュ浘 zoom: '1',//缂╂斁姣斾緥 method: 'auto'//鎻愪氦鏂规硶锛岀敤浜庝笉鍚岀殑娴忚鍣ㄧ幆澧冿紝榛樿涓衡€榓uto鈥 }); } //璋冪敤瀹㈡湇鎸夐挳 $(function () { $('.selectFlag').bind('click', function () { var myModal = $('#myModal'); myModal.modal('show'); }); var wflag = false; $('.weixin').bind('click', function () { var self = $(this); if (!wflag) { wflag = true; self.find('span').css('display', 'block'); } else { wflag = false; self.find('span').css('display', 'none'); } }); new Swiper('#nav_sec', { slidesPerView: 'auto', hashNavigation: { watchState: true } }); $('.select_list span').bind('click', function () { var self = $(this), aSelf = $('.select_list span.active'); aSelf.removeClass('active'); self.addClass('active'); }); $('.confirmOk').bind('click', function () { var aSelf = $('.select_list span.active'), itemId = aSelf.attr('itemid'), wurl = $('#url').val() + itemId; top.location = wurl; }); $('.index_select').change(function () { var self = $(this); window.location.href = self.val();//椤甸潰璺宠浆骞朵紶鍙 }); $('.product_more').bind('click', function () { console.log('start'); var page = parseInt($('#page').val()) + 1, total = parseInt($('#total').val()), pageURI = $('#pageURI').val() + '&p=' + page, myModal = $('#myModal'); console.log(page); console.log(total); if (page <= total) { console.log('start2'); $.ajax({ url: pageURI, cache: false, type: 'GET', dataType: 'json', success: function (ajaxData) { //澶勭悊璋冪敤鎴愬姛浜嬩欢 if (ajaxData.status) { var content = ajaxData.data.content; $('.more_list').append(content); $('#page').val((page)); var pageView = $('#pageview').val(); switch (pageView) { case 'video': $('.vimg').jqthumb({ width: '100%', height: '100%' }); break; case 'album': imgsdata= imgsdata.concat(ajaxData.data.list); console.log(imgsdata); break; } } else { $('.more_other').removeClass('hide').html(ajaxData.message); return false; } } }); } else { //澧炲姞鎻愮ず浠g爜 $('.more_other').removeClass('hide').html('娌℃湁鏇村鏁版嵁'); return false; } }); var flag = 1; $('.lcbody,#leftnav').click(function () { if (flag == 1) { //灞曞紑 $('body').addClass('open'); $('#leftnav').show(); flag = 0; } else { //闂悎 $('body').removeClass('open'); var t = setTimeout("$('#leftnav').hide()", 1); flag = 1; } }); $('.go-top').bind('click', function () { $(window).scrollTop(0); }); if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))) { var wow = new WOW( { animateClass: 'animated', offset: 100, callback: function (box) { console.log("WOW: animating <" + box.tagName.toLowerCase() + ">") } } ); wow.init(); } $('.nav_sec').affix(); $('.fixed_nav').affix(); }); //涓殑onmouseover 鏀规垚 onclick; //]]> function selectpic(id) { var imgsrc = id.src; $('#product_pic').attr('src', imgsrc); } function checkorder() { var username = $('#username').val(); var idcode = $('#idcode').val(); var telphone = $('#telphone').val(); var code = $('#code').val(); var flag = true, msg = ''; if (username === "") { msg += '璇疯緭鍏ュ鍚岦br/>'; flag = false; } if (telphone === "") { msg += '璇疯緭鍏ヨ仈绯荤數璇滭br/>'; flag = false; } if (code === "") { msg += '璇疯緭鍏ラ獙璇佺爜
'; flag = false; } if (!flag) { var myModal = $('#myModal'); myModal.find('.modal-header').removeClass('hide'); myModal.find('.modal-footer').removeClass('hide'); myModal.find('.btn-primary').addClass('hide'); myModal.find('.modal-body').html(msg); myModal.modal('show'); myModal.find('.btn-default').html('纭畾'); return false; } return true; } var goSwipe = function (obj, direction) { var self = $('.' + obj), selfObj, tabKey, nextTabKey, nextObj, data_count = parseInt(self.attr('data_count')); selfObj = self.find('.active'); //褰撳墠鏄剧ず鐨勫璞 tabKey = parseInt(selfObj.attr('tab_key')); if (direction == 'next') { if (tabKey > 0) { nextTabKey = tabKey - 1; } else { nextTabKey = data_count; } } else { if (tabKey < data_count) { nextTabKey = tabKey + 1; } else { nextTabKey = 0; } } nextObj = $('#' + obj + nextTabKey); //涓嬩竴涓渶瑕佹樉绀虹殑瀵硅薄 console.log('nextTabKey:' + nextTabKey); console.log('tabKey:' + tabKey); selfObj.addClass('hide').removeClass('active'); //鍘绘帀褰撳墠tab鐨勯€変腑鍙婂鍔犻殣钘 nextObj.removeClass('hide').addClass('active'); //缁欎笅涓€涓猼ab鍘绘帀闅愯棌锛屽鍔犻€変腑 };