Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dic-global-dev
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Manzar Hussain
dic-global-dev
Commits
20792b60
Commit
20792b60
authored
Dec 31, 2020
by
Manzar Hussain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add sticky js
parent
d9b67ad8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
2 deletions
+41
-2
override.js
themes/custom/envigo/js/override.js
+41
-2
No files found.
themes/custom/envigo/js/override.js
View file @
20792b60
...
@@ -94,4 +94,43 @@
...
@@ -94,4 +94,43 @@
$
(
"#simplenews-subscriptions-block-226b1abd-464c-4b6e-b0d2-301af005f689 input"
).
attr
(
'placeholder'
,
'Enter your email'
);
$
(
"#simplenews-subscriptions-block-226b1abd-464c-4b6e-b0d2-301af005f689 input"
).
attr
(
'placeholder'
,
'Enter your email'
);
$
(
"#edit-subscribe"
).
html
(
'Submit'
);
$
(
"#edit-subscribe"
).
html
(
'Submit'
);
})(
jQuery
);
\ No newline at end of file
var
$sticky
=
$
(
'.sticky'
);
var
$stickyrStopper
=
$
(
'.sticky-stopper'
);
if
(
$sticky
.
offset
())
{
var
generalSidebarHeight
=
$sticky
.
innerHeight
();
var
stickyTop
=
$sticky
.
offset
().
top
;
var
stickOffset
=
0
;
var
stickyStopperPosition
=
$stickyrStopper
.
offset
().
top
;
//console.log(stickyStopperPosition);
console
.
log
(
generalSidebarHeight
)
var
stopPoint
=
stickyStopperPosition
-
generalSidebarHeight
-
stickOffset
;
var
diff
=
stopPoint
+
stickOffset
;
console
.
log
(
stickyTop
)
$
(
window
).
scroll
(
function
(){
var
windowTop
=
$
(
window
).
scrollTop
();
var
windowWidth
=
$
(
window
).
width
();
/* var innerWidth = $('.fixedHeadercontainer').innerHeight();
innerWidth = innerWidth + 30; */
if
(
windowWidth
>
767
)
{
if
(
stopPoint
<
windowTop
)
{
$sticky
.
css
({
position
:
'relative'
,
top
:
'100%'
,
'margin-top'
:
-
(
generalSidebarHeight
+
70
)});
}
else
if
(
stickyTop
<
windowTop
+
stickOffset
)
{
$sticky
.
css
({
position
:
'fixed'
,
top
:
stickOffset
,
'margin-top'
:
0
});
}
else
{
$sticky
.
css
({
position
:
'absolute'
,
top
:
'initial'
,
'margin-top'
:
0
});
}
}
});
}
$
(
".subheadings-list li a"
).
on
(
"click"
,
function
(
event
)
{
event
.
preventDefault
();
var
dataContent
=
$
(
this
).
attr
(
'page-event'
);
var
b
=
$
(
'.ba_r_i_w'
).
find
(
'.'
+
dataContent
);
var
a
=
b
.
offset
().
top
;
$
(
"html, body"
).
animate
({
scrollTop
:
a
},
700
);
});
})(
jQuery
);
\ No newline at end of file
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