Skip to content

Commit

Permalink
fixed timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
acmoune committed Jun 21, 2024
1 parent 85e8958 commit 8a4c9fc
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions src/OsanWebsite.Web/Pages/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
}

@section coolheader {
<div class="slide-show" style="height: 282px;">
<div class="slide-show" style="">
@foreach (var slide in Model.SlideShow.Pictures)
{
<partial name="_SlideItem" model=@slide />
Expand Down Expand Up @@ -98,20 +98,22 @@
autoplaySpeed: 5000,
});
var feedHeader = document.getElementById("feed-header");
var sticky = feedHeader.offsetTop;
function shouldStickFeedHeader() {
if (window.pageYOffset > sticky) {
feedHeader.classList.add("sticky");
document.body.classList.add("sticky-body");
} else {
feedHeader.classList.remove("sticky");
document.body.classList.remove("sticky-body");
setTimeout(() => {
var feedHeader = document.getElementById("feed-header");
var sticky = feedHeader.offsetTop;
function shouldStickFeedHeader() {
if (window.pageYOffset > sticky) {
feedHeader.classList.add("sticky");
document.body.classList.add("sticky-body");
} else {
feedHeader.classList.remove("sticky");
document.body.classList.remove("sticky-body");
}
}
}
window.onscroll = function () { shouldStickFeedHeader() };
window.onscroll = function () { shouldStickFeedHeader() };
}, 3000);
});
</script>

Expand Down

0 comments on commit 8a4c9fc

Please sign in to comment.