Commit 88b19305 by 林翔

lx

parent 5830ce40
Showing with 26 additions and 8 deletions
...@@ -44,7 +44,8 @@ var xinhot = { ...@@ -44,7 +44,8 @@ var xinhot = {
// var top = $(".product-mask-content").offset().top; //获取某个元素距顶部的距离 // var top = $(".product-mask-content").offset().top; //获取某个元素距顶部的距离
// $("body,html").animate({scrollTop:(top-50)+"px"},500); // $("body,html").animate({scrollTop:(top-50)+"px"},500);
$("body,html").css({"overflow":"hidden"}); $("body,html").css({"overflow":"hidden"});
$("body,html").css({"position":"fixed"},{"top":"0"}); var top = $(window).scrollTop(); //获取页面的scrollTop
$("body,html").css({"position":"fixed"},{"top":(-top/100)+"rem"});
$.ajax({ $.ajax({
url:'./json/brandData.json', url:'./json/brandData.json',
...@@ -65,6 +66,14 @@ var xinhot = { ...@@ -65,6 +66,14 @@ var xinhot = {
$(".product-mask-introduce").html(brandData[brandId].introduce); $(".product-mask-introduce").html(brandData[brandId].introduce);
} }
}) })
//关闭弹窗
$(".mask-close").click(function(){
$(this).parents(".mask").hide();
$("body,html").css({"overflow":"auto"});
$("body,html").css({"position":"relative"});
$(window).scrollTop(top); //设置页面滚动的高度,如果不设置,关闭弹出层时页面会回到顶部
});
}); });
//联系我们 //联系我们
...@@ -75,7 +84,8 @@ var xinhot = { ...@@ -75,7 +84,8 @@ var xinhot = {
// var top = $(".contact-mask-content").offset().top; //获取某个元素距顶部的距离 // var top = $(".contact-mask-content").offset().top; //获取某个元素距顶部的距离
// $("body,html").animate({scrollTop:(top-50)+"px"},500); // $("body,html").animate({scrollTop:(top-50)+"px"},500);
$("body,html").css({"overflow":"hidden"}); $("body,html").css({"overflow":"hidden"});
$("body,html").css({"position":"fixed"},{"top":"0"}); var top = $(window).scrollTop(); //获取页面的scrollTop
$("body,html").css({"position":"fixed"},{"top":(-top/100)+"rem"});
$.ajax({ $.ajax({
url:'./json/jobData.json', url:'./json/jobData.json',
...@@ -89,14 +99,22 @@ var xinhot = { ...@@ -89,14 +99,22 @@ var xinhot = {
$(".job_position").html(jobData[jobId].jobPosition); $(".job_position").html(jobData[jobId].jobPosition);
$(".job_requirement").html(jobData[jobId].jobRequirement); $(".job_requirement").html(jobData[jobId].jobRequirement);
} }
}) });
//关闭弹窗
$(".mask-close").click(function(){
$(this).parents(".mask").hide();
$("body,html").css({"overflow":"auto"});
$("body,html").css({"position":"relative"});
$(window).scrollTop(top);//设置页面滚动的高度,如果不设置,关闭弹出层时页面会回到顶部
});
}); });
//关闭弹窗 //关闭弹窗
$(".mask-close").click(function(){ // $(".mask-close").click(function(){
$(this).parents(".mask").hide(); // $(this).parents(".mask").hide();
$("body,html").css({"overflow":"auto"}); // $("body,html").css({"overflow":"auto"});
$("body,html").css({"position":"relative"},{"top":"auto"}); // $("body,html").css({"position":"relative"},{"top":"auto"});
}); // });
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment