Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
梁建民
/
xinhot
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d911141c
authored
Mar 13, 2019
by
林翔
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
lx
parent
d5366b91
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
23 deletions
h5/js/index.js
h5/js/index.js
View file @
d911141c
...
@@ -43,9 +43,9 @@ var xinhot = {
...
@@ -43,9 +43,9 @@ 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"
}
,{
"height"
:
"100%"
}
);
$
(
"body,html"
).
css
({
"overflow"
:
"hidden"
});
//
var top = $(window).scrollTop(); //获取页面的scrollTop
var
top
=
$
(
window
).
scrollTop
();
//获取页面的scrollTop
//
$("body,html").css({"position":"fixed"},{"top":(-top/100)+"rem"});
$
(
"body,html"
).
css
({
"position"
:
"fixed"
},{
"top"
:(
-
top
/
100
)
+
"rem"
});
$
.
ajax
({
$
.
ajax
({
url
:
'./json/brandData.json'
,
url
:
'./json/brandData.json'
,
...
@@ -68,12 +68,12 @@ var xinhot = {
...
@@ -68,12 +68,12 @@ var xinhot = {
})
})
//关闭弹窗
//关闭弹窗
//
$(".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"});
$
(
"body,html"
).
css
({
"position"
:
"relative"
});
//
$(window).scrollTop(top); //设置页面滚动的高度,如果不设置,关闭弹出层时页面会回到顶部
$
(
window
).
scrollTop
(
top
);
//设置页面滚动的高度,如果不设置,关闭弹出层时页面会回到顶部
//
});
});
});
});
//联系我们
//联系我们
...
@@ -83,9 +83,9 @@ var xinhot = {
...
@@ -83,9 +83,9 @@ 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"
}
,{
"height"
:
"100%"
}
);
$
(
"body,html"
).
css
({
"overflow"
:
"hidden"
});
//
var top = $(window).scrollTop(); //获取页面的scrollTop
var
top
=
$
(
window
).
scrollTop
();
//获取页面的scrollTop
//
$("body,html").css({"position":"fixed"},{"top":(-top/100)+"rem"});
$
(
"body,html"
).
css
({
"position"
:
"fixed"
},{
"top"
:(
-
top
/
100
)
+
"rem"
});
$
.
ajax
({
$
.
ajax
({
url
:
'./json/jobData.json'
,
url
:
'./json/jobData.json'
,
...
@@ -102,19 +102,19 @@ var xinhot = {
...
@@ -102,19 +102,19 @@ var xinhot = {
});
});
//关闭弹窗
//关闭弹窗
//
$(".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"});
$
(
"body,html"
).
css
({
"position"
:
"relative"
});
//
$(window).scrollTop(top);//设置页面滚动的高度,如果不设置,关闭弹出层时页面会回到顶部
$
(
window
).
scrollTop
(
top
);
//设置页面滚动的高度,如果不设置,关闭弹出层时页面会回到顶部
//
});
});
});
});
//关闭弹窗
//关闭弹窗
$
(
".mask-close"
).
click
(
function
(){
//
$(".mask-close").click(function(){
$
(
this
).
parents
(
".mask"
).
hide
();
//
$(this).parents(".mask").hide();
$
(
"body,html"
).
css
({
"overflow"
:
"auto"
},{
"height
"
:
"auto"
});
// $("body,html").css({"overflow
":"auto"});
//
$("body,html").css({"position":"relative"},{"top":"auto"});
//
$("body,html").css({"position":"relative"},{"top":"auto"});
});
//
});
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment