Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
makura-2025
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Raj Shah
makura-2025
Commits
9a912761
Commit
9a912761
authored
Jun 24, 2025
by
Arjun Jhukal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated the minor changes
parent
4256076a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
21 deletions
+52
-21
script.js
assets/js/script.js
+52
-21
No files found.
assets/js/script.js
View file @
9a912761
...
@@ -132,32 +132,63 @@
...
@@ -132,32 +132,63 @@
$
(
".category-list"
).
removeClass
(
"active"
);
$
(
".category-list"
).
removeClass
(
"active"
);
});
});
const
tocObserver
=
new
IntersectionObserver
(
// const tocObserver = new IntersectionObserver(
function
(
entries
)
{
// function (entries) {
entries
.
forEach
((
entry
)
=>
{
// entries.forEach((entry) => {
if
(
entry
.
isIntersecting
)
{
// if (entry.isIntersecting) {
$
(
".toc h6"
).
show
();
// $(".toc h6").show();
console
.
log
(
"is intersecting"
)
// console.log("is intersecting")
}
else
{
// } else {
$
(
".toc h6"
).
hide
();
// $(".toc h6").hide();
console
.
log
(
"is not intersecting"
)
// console.log("is not intersecting")
}
// }
});
// });
},
// },
{
// {
threshold
:
0.3
,
// threshold: 0.1,
},
// },
);
// );
// const sections = [
// document.querySelector(".BLOGDETAIL-LIST-ITEM-SECTION"),
// document.querySelector(".BLOGLISTING-LIST-ITEM-SECTION"),
// document.querySelector(".case-study-general"),
// ];
// sections.length &&
// sections.forEach((section) => {
// if (section) tocObserver.observe(section);
// });
const
sections
=
[
const
sections
=
[
document
.
querySelector
(
".BLOGDETAIL-LIST-ITEM-SECTION"
),
document
.
querySelector
(
".BLOGDETAIL-LIST-ITEM-SECTION"
),
document
.
querySelector
(
".BLOGLISTING-LIST-ITEM-SECTION"
),
document
.
querySelector
(
".BLOGLISTING-LIST-ITEM-SECTION"
),
document
.
querySelector
(
".case-study-general"
),
document
.
querySelector
(
".case-study-general"
),
];
];
sections
.
length
&&
sections
.
forEach
((
section
)
=>
{
// Filter out any null sections
if
(
section
)
tocObserver
.
observe
(
section
);
const
validSections
=
sections
.
filter
(
Boolean
);
});
if
(
validSections
.
length
)
{
const
handleScroll
=
()
=>
{
const
scrollTop
=
$
(
window
).
scrollTop
();
const
viewportHeight
=
$
(
window
).
height
();
if
(
scrollTop
>
viewportHeight
)
{
$
(
".toc h6"
).
show
();
console
.
log
(
"Scrolled past 100vh"
);
}
else
{
$
(
".toc h6"
).
hide
();
console
.
log
(
"Above 100vh"
);
}
};
// Bind scroll event
$
(
window
).
on
(
"scroll"
,
handleScroll
);
// Run on page load too
$
(
document
).
ready
(
handleScroll
);
}
});
});
/** MOBILE OFFCANVAS TOC ENDS HERE */
/** MOBILE OFFCANVAS TOC ENDS HERE */
...
...
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