// 出场动画 $(document).on('ready scroll', function(event) { divmove('.index-news'); }); $(function(){ // 控制新闻最大高度 var array = []; $('.index-news-list').each(function(){ var maxh = $(this).find('.index-news-one').eq(0).outerheight() + $(this).find('.index-news-one').eq(1).outerheight() + $(this).find('.index-news-one').eq(2).outerheight(); array.push(maxh); }) if(ww>992){ $('.index-news-list-all').height(math.max.apply(null, array) + 45) }else{ $('.index-news-list').height(math.max.apply(null, array) + 50) } /********案例详情页图片hover效果**********/ // var native_width = 0; // var native_height = 0; // var $wh=$(window).height(); // $(".big_img").mousemove(function(e){ // index=$(this).index(); // if(!native_width && !native_height) // { // var image_object = new image(); // image_object.src = $(".zoomed").eq(index-1).data("src"); // native_width = image_object.width; //图片的宽度 // native_height = image_object.height; //图片的高度 // } // else // { // var magnify_offset = $(this).offset(); // var my = e.pagey - magnify_offset.top;//鼠标当前位置距离图片顶部的距离 // var h = $(this).width() * (native_height/native_width)//图片的实际高度 // var grad = (h - ($(this).height())) / ($(this).height()); // var bgp0 = 0 + "px " + 0 + "px"; // var bgp1 = 0 + "px " + -(my-100)*grad + "px"; // var bgp2 = 0 + "px " + -(my+100)*grad + "px"; // if(h<$wh){ // $(this).find('.zoomed.open').css({backgroundposition: bgp0,"height":h,"top":"50%","transform":"translatey(-50%)"}); // }else{ // if(my>=100&& my<$wh/2){ // $(this).find('.zoomed.open').css({backgroundposition: bgp1,"height":$wh-100}); // }else if(my<$wh-100 && my>=$wh/2){ // $(this).find('.zoomed.open').css({backgroundposition: bgp2,"height":$wh-100}); // } // } // } // }); // $(".big_img").hover(function(){ // },function(){ // $('.productphoto').removeclass('open'); // $('.big_img').fadeout("slow"); // $('.big_img .zoomed').removeclass('open'); // $('.bg-shadow').removeclass('open') // }); // var index; // $(".productphoto").hover(function(e){ // index=$(this).index(); // var image_object = new image(); // image_object.src = $(".zoomed").eq(index-1).data("src"); // native_width = image_object.width; //图片的宽度 // native_height = image_object.height; //图片的高度 // if($(window).width() > 768){ // var magnify_offset = $(this).offset(); // var my = e.pagey - magnify_offset.top; // var h = $(this).width() * (native_height/native_width); //图片自适应高度 // var grad = (h - $(this).height()) / $(this).height(); // var bgp = 0 + "px " + -my*grad + "px"; // var bgp2 = 0 + "px " + 0 + "px"; // $(this).addclass('open'); // $('.big_img').fadein("slow"); // $('.big_img .zoomed').eq(index-1).addclass('open'); // if(h<$wh){ // $('.big_img .zoomed.open').css({backgroundposition: bgp2,"height":h}); // }else{ // $('.big_img .zoomed.open').css({backgroundposition: bgp,"height":$wh-100}); // } // $('.bg-shadow').addclass('open'); // } // }); /********案例详情页图片hover效果结束**********/ }); function getmaxh(class){ var maxh = 0; var array = []; $(class).each(function(){ array.push(parseint($(this).height())); }) $(class).height(math.max.apply(null, array)) }