1var ecblib = ecblib || {}; 2ecblib.goods_ajax_quickview = ecblib.goods_ajax_quickview || {}; 3 4(function () { 5 var _goods_ajax_quickview = ecblib.goods_ajax_quickview; 6 7 var errContents = '<div class="block-quickview js-goods-quickview">' + ecblib.msg.goods_ajax_quickview.NO_DETAIL_INFO + '</div>'; 8 var timerQuickView = null; 9 jQuery(document).ready(function () { 10 jQuery('img[data-ref-goods]').parents('.js-goods-quickview-hover').hover(function () { 11 var target = this; 12 timerQuickView = setTimeout(function () { 13 addQuickView(target); 14 }, 200); 15 }, function () { 16 clearTimeout(timerQuickView); 17 timerQuickView = null; 18 removeQuickView(this); 19 }); 20 }); 21 22 function addQuickView(elm) { 23 jQuery.ajax({ 24 type: 'GET', 25 url: ecblib.sys.pathroot + '/goods/quickviewajax.aspx', 26 data: { 27 'goods': jQuery(elm).find('img[data-ref-goods]').attr('data-ref-goods') 28 }, 29 cache: false, 30 success: function (data) { 31 doAddQuickView(elm, data); 32 }, 33 error: function () { 34 doAddQuickView(elm, errContents); 35 } 36 }); 37 } 38 39 function doAddQuickView(elm, data) { 40 if (timerQuickView == null) { 41 return; 42 } 43 jQuery(elm).append(data); 44 var topQuickView = jQuery(elm).offset().top - 10; 45 var leftQuickView = jQuery(elm).offset().left - jQuery(elm).find('.js-goods-quickview').width(); 46 jQuery(elm).find('.js-goods-quickview').css({ 47 'top': topQuickView, 48 'left': leftQuickView 49 }); 50 jQuery(elm).find('.js-goods-quickview').queue([]).fadeIn('fast'); 51 if (1 < jQuery(document).find('.js-goods-quickview').length) { 52 jQuery(document).find('.js-goods-quickview').each(function (key, value) { 53 if (jQuery(value).position().top == topQuickView && jQuery(value).position().left == leftQuickView) { 54 jQuery(elm).find('.js-goods-quickview').nextAll().remove('div.js-goods-quickview'); 55 return false; 56 } else { 57 jQuery(value).remove(); 58 } 59 }); 60 } 61 } 62 63 function removeQuickView(elm) { 64 var quickView = jQuery(elm).find('.js-goods-quickview'); 65 if (quickView) { 66 quickView.queue([]).fadeOut('fast', function () { 67 quickView.remove(); 68 }); 69 } 70 } 71}());
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.