$(function() { $('#show360btn').click(function(){ $('.box').css('left','0') /* $('.navbar').hide() $('.liuyan_lit').remove()*/ }) $('.box_img .fclose').click(function(){ $('.box').css('left','-999999px') }) $('.product_block').eq(0).css({ 'margin-top':'-10px' }) if (window.location.href.split('?').length > 1) { var url = window.location.href.split('?')[1].split('=')[1] $('.news_channel li').each(function() { if ($(this).attr('cname') == decodeURI(url)) { $(this).addClass('active') } }) $('.product_block').each(function() { if ($(this).attr('cname') == decodeURI(url)) { $("html,body").animate({ scrollTop: $(this).offset().top - 112 }, 100); } }) } $('.product_parameters li').each(function(index){ var height=$(this).css('height') $(this).attr('dh',$(this).css('height').substr(0,height.length-2)) }) if(ismobile*1==1){ $('.product_parameters li').each(function(index){ //console.log($(this).find('.txt').css('height')) if(index%2==0){ if($('.product_parameters li').eq(index+1)){ var meh=$(this).attr('dh')*1 var nexth=$('.product_parameters li').eq(index+1).attr('dh')*1 //console.log($('.product_parameters li').eq(index+1).find('.txt').html()) var max=meh>nexth?meh:nexth console.log('row'+index+':'+meh) console.log('row'+(index*1+1)+':'+nexth) console.log(max) $(this).css({ 'height':max+'px' }) $('.product_parameters li').eq(index+1).css('height',max) } } }) }else{ $('.product_parameters li').each(function(index){ //console.log($(this).find('.txt').css('height')) if(index%4==0){ var max=$(this).attr('dh')*1 for (var i = 1; i <= 3; i++) { if($('.product_parameters li').eq(index+i)){ var nexth=$('.product_parameters li').eq(index+i).attr('dh')*1 //console.log($('.product_parameters li').eq(index+1).find('.txt').html()) var max=max>nexth?max:nexth /*console.log('row'+index+':'+meh) console.log('row'+(index*1+1)+':'+nexth) console.log(max)*/ /*$(this).css({ 'height':max+'px' }) $('.product_parameters li').eq(index+1).css('height',max)*/ } } for (var i = 0; i <= 3; i++) { $('.product_parameters li').eq(index+i).css('height',max) } } }) } if($('.product_detail_payment li').length%2==1){ $('.product_detail_payment li').eq($('.product_detail_payment li').length-1).addClass('lasteven') } if ($(window).width() > 1100) { if($('.product_detail_payment li').length==3){ $('.product_detail_payment').addClass('pc3') } } $('.product_block .product_list a li').each(function(){ var bg = $(this).attr('data-hover') $(this).css({ 'background-image': 'url(' + bg + ')' }) }) $('.product_block .product_list a li').hover(function() { var bg = $(this).attr('data-hover') $(this).css({ 'background-image': 'url(' + bg + ')' }) }, function() { }) function adjust(){ $('.product_block .product_list a li .img_p').each(function() { var ch = $(this).width() var ph = $(this).closest('li').width() $(this).css({ 'left': (ph - ch) / 2 + 'px' }) console.log(ph) console.log(ch) }) } adjust() setTimeout(function() { adjust() }, 1000) setTimeout(function() { adjust() }, 2000) var width var height if ($(window).width() > 1440) { width = 435 height = 447 } else if ($(window).width() > 1100) { width = 335 height = 347 } function init() { product1 = $('.product1').ThreeSixty({ totalFrames: 25, endFrame: 25, currentFrame: 1, imgList: '.threesixty_images', progress: '.spinner', imagePath: '/cms/360/' + thisid + '/', filePrefix: '', ext: '.png', height: height, width: width, navigation: false, disableSpin: false }); } init() })