特效模板:ej,客户案例:whtts
DIV:
<div class="product">$func_submenu(para=product,title=no,img=2,mode=2,bg=1,submemo=1,submore=VIEW MORE,rows=3,divi=none)$</div>
CSS:
.product ul{ display:inline-block; width:100%; font-size:0;}
.product ul li{ display:inline-block; width:100%; height:610px; font-size:0; margin-bottom:-7px; "background-position":"center"}
.product ul li .mode{ margin:0 auto; width:1200px; text-align:right;}
.product ul li .mode{ margin-top:100px;}
.product ul li:nth-child(2n) .mode{ text-align:left;}
.product ul li .mode .title a{ display:block; font-size:56px; font-weight:bold;}
.product ul li .mode .title a span{ color:#E63D3A; font-size:56px;}
.product ul li .mode .memo{ color:#7c7c7c; line-height:80px;}
.product ul li .mode .more{ margin-top:20px;}
.product ul li .mode .more a{ display:inline-block; width:150px; border:2px solid #333; text-align:center; line-height:40px;}
.product ul li .mode .more a:hover{ border:2px solid #E63D3A;}
JS:
$(function(){
var img1=$(".product ul .li1").css("background-image");
var img2=$(".product ul .li2").css("background-image");
var img3=$(".product ul .li3").css("background-image");
var h1=($(window).height() - $(".product ul .li1").height())/2;
var h2=$(".banner").height();
$(".product ul li").css({"background-image":"none","margin-bottom":h1});
$(".product ul .li1").css({"margin-top":0,"background-image":img1,"background-position":"center"});
var up=1;
$(window).scroll(function(){
if($(window).scrollTop()>up){
up=$(window).scrollTop();
if(up<h2){$("body").css({"background-image":"none"});$(".product ul .li1").css({"margin-top":0});}
if((up>h2-h1)&&(up<h2)){
$(".product ul .li1").css({"margin-top":up-h2+h1,"margin-bottom":h1});
$(".product ul .li2").css({"background-image":"none"});
$(".product ul .li3").css({"background-image":"none"});
}
if((up>h2)&&(up<$(".product ul .li2").offset().top)){
$(".product ul .li1").css({"margin-top":h1,"margin-bottom":h1});
$("body").css({"background-image":img2,"background-repeat":"no-repeat","background-attachment":"fixed","background-position":"center"});
}
if((up<$(".product ul .li2").offset().top-h1)&&(up<$(".product ul .li2").offset().top)){
$("body").css({"background-image":img2,"background-repeat":"no-repeat","background-attachment":"fixed","background-position":"center"});
}
if((up>$(".product ul .li2").offset().top-h1)){
$(".product ul .li2").css({"background-image":img2,"background-position":"center"});
$(".product ul .li1").css({"background-image":"none"});
$(".product ul .li3").css({"background-image":"none"});
$("body").css({"background-image":img3,"background-repeat":"no-repeat","background-attachment":"fixed","background-position":"center"});
}
if(up>$(".product ul .li3").offset().top-h1){
$(".product ul .li3").css({"background-image":img3,"background-position":"center","margin-bottom":0});
$(".product ul .li1").css({"background-image":"none"});
$(".product ul .li2").css({"background-image":"none"});
$("body").css({"background-image":"none"});
}
}else{
up=$(window).scrollTop();
$(".product ul .li1").css({"margin-top":0});
if(($(window).scrollTop()<$(".product ul .li3").offset().top-h1)){
$("body").css({"background-image":img2,"background-repeat":"no-repeat","background-attachment":"fixed","background-position":"center"});
$(".product ul .li3").css({"background-image":img3,"background-position":"center"});
$(".product ul .li2").css({"background-image":"none"});
$(".product ul .li2").css({"background-image":"none","margin-top":0});
}
if(($(window).scrollTop()<$(".product ul .li2").offset().top-h1)){
$("body").css({"background-image":img1,"background-repeat":"no-repeat","background-attachment":"fixed","background-position":"center"});
$(".product ul .li2").css({"background-image":img2,"background-position":"center"});
$(".product ul .li3").css({"background-image":"none"});
}
if($(window).scrollTop()<h2-h1){
$("body").css({"background-image":"none"});
$(".product ul .li1").css({"background-image":img1,"background-position":"center"});
$(".product ul .li2").css({"background-image":"none"});
$(".product ul .li3").css({"background-image":"none"});
}
}
});
for(var i=0;i<$(".product ul li").length;i++){
var title=$(".product ul li").eq(i).find(".title a").html();
var len=title.length;
var ref=6;
if(i==1){ ref=3;}
$(".product ul li").eq(i).find(".title a").html("<span>"+title.substr(0,ref)+"</span>"+title.substr(ref,len-ref));
}
}); |