NavBar Transition CSS TroubleSet cellpadding and cellspacing in CSS?Convert HTML + CSS to PDF with PHP?How do I give text or an image a transparent background using CSS?Is there a CSS parent selector?When to use margin vs padding in CSSChange an HTML5 input's placeholder color with CSSTransitions on the display: propertyHow can I transition height: 0; to height: auto; using CSS?How do I vertically center text with CSS?Is it possible to apply CSS to half of a character?

Mathematical uses of string theory

What is the hex versus octal timeline?

Why did this happen to Thanos's ships at the end of "Avengers: Endgame"?

How to avoid using System.String with Rfc2898DeriveBytes in C#

What is this symbol: semicircles facing eachother

Why is Boris Johnson visiting only Paris & Berlin if every member of the EU needs to agree on a withdrawal deal?

What to say to a student who has failed?

When translating the law, who ensures that the wording does not change the meaning of the law?

Script that helps people make better choices

How to stop this icon from appearing on the taskbar?

Why is 日本 read as "nihon" but not "nitsuhon"?

Did the British navy fail to take into account the ballistics correction due to Coriolis force during WW1 Falkland Islands battle?

Can I switch to third-person while not in 'town' in Destiny 2?

Is there any practical application for performing a double Fourier transform? ...or an inverse Fourier transform on a time-domain input?

Why can't an Airbus A330 dump fuel in an emergency?

Concatenation of the result of a function with a mutable default argument in python

Potential new partner angry about first collaboration - how to answer email to close up this encounter in a graceful manner

Is “I am getting married with my sister” ambiguous?

Is refusing to concede in the face of an unstoppable Nexus combo punishable?

Why does my house heat up, even when it's cool outside?

How much code would a codegolf golf if a codegolf could golf code?

How can I watch the 17th (or last, if less) line in files of a folder?

How to write triplets in 4/4 time without using a 3 on top of the notes all the time

Why doesn't the Falcon-9 first stage use three legs to land?



NavBar Transition CSS Trouble


Set cellpadding and cellspacing in CSS?Convert HTML + CSS to PDF with PHP?How do I give text or an image a transparent background using CSS?Is there a CSS parent selector?When to use margin vs padding in CSSChange an HTML5 input's placeholder color with CSSTransitions on the display: propertyHow can I transition height: 0; to height: auto; using CSS?How do I vertically center text with CSS?Is it possible to apply CSS to half of a character?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I have a Navbar which makes a transition when I scroll down.

When I scroll up, the transition doesn't work and I don't know why. Can someone help me resolve this?



The JS code is adding the scrolled class when Math.round($(window).scrollTop()) > 100.






@supports (position: sticky) 
body
padding-top: 0;


header
position: sticky;




.scrolled
transition: 0.5s ease;


.scrolled.header
height: 50px;
background-color: rgba(0, 0, 0, 0.8);
transition: 0.5s ease;


.scrolled.header .header-menu
line-height: 40px;
transition: 0.5s ease;

<div class="block">
<header class="header">
<a href="#" class="header-logo"><i class="fas fa-signal"></i>NAME</a>
<nav class="header-menu">
<a href="#">Accueil</a>
<a href="#">Compétences</a>
<a href="#">Parcours</a>
<a href="#">Projets</a>
<a href="#">Hobbies</a>
<a href="#">Contact</a>
</nav>
<a href="#" class="toggle" id="burgerButton">
<i class="fas fa-bars"></i>
</a>
</header>
</div>












share|improve this question


























  • Hi! Welcome to SO! In order for folks to help they generally appreciate an MCVE to reproduce the behavior describe and fully troubleshoot the issue. As it sits if we can't reproduce the issue then it may be left to assumptions/guessing. As it sits we're note sure what the transition-property is in the first place and it'd difficult to visualize the issue you're describing.

    – Chris W.
    Mar 27 at 16:32

















0















I have a Navbar which makes a transition when I scroll down.

When I scroll up, the transition doesn't work and I don't know why. Can someone help me resolve this?



The JS code is adding the scrolled class when Math.round($(window).scrollTop()) > 100.






@supports (position: sticky) 
body
padding-top: 0;


header
position: sticky;




.scrolled
transition: 0.5s ease;


.scrolled.header
height: 50px;
background-color: rgba(0, 0, 0, 0.8);
transition: 0.5s ease;


.scrolled.header .header-menu
line-height: 40px;
transition: 0.5s ease;

<div class="block">
<header class="header">
<a href="#" class="header-logo"><i class="fas fa-signal"></i>NAME</a>
<nav class="header-menu">
<a href="#">Accueil</a>
<a href="#">Compétences</a>
<a href="#">Parcours</a>
<a href="#">Projets</a>
<a href="#">Hobbies</a>
<a href="#">Contact</a>
</nav>
<a href="#" class="toggle" id="burgerButton">
<i class="fas fa-bars"></i>
</a>
</header>
</div>












share|improve this question


























  • Hi! Welcome to SO! In order for folks to help they generally appreciate an MCVE to reproduce the behavior describe and fully troubleshoot the issue. As it sits if we can't reproduce the issue then it may be left to assumptions/guessing. As it sits we're note sure what the transition-property is in the first place and it'd difficult to visualize the issue you're describing.

    – Chris W.
    Mar 27 at 16:32













0












0








0








I have a Navbar which makes a transition when I scroll down.

When I scroll up, the transition doesn't work and I don't know why. Can someone help me resolve this?



The JS code is adding the scrolled class when Math.round($(window).scrollTop()) > 100.






@supports (position: sticky) 
body
padding-top: 0;


header
position: sticky;




.scrolled
transition: 0.5s ease;


.scrolled.header
height: 50px;
background-color: rgba(0, 0, 0, 0.8);
transition: 0.5s ease;


.scrolled.header .header-menu
line-height: 40px;
transition: 0.5s ease;

<div class="block">
<header class="header">
<a href="#" class="header-logo"><i class="fas fa-signal"></i>NAME</a>
<nav class="header-menu">
<a href="#">Accueil</a>
<a href="#">Compétences</a>
<a href="#">Parcours</a>
<a href="#">Projets</a>
<a href="#">Hobbies</a>
<a href="#">Contact</a>
</nav>
<a href="#" class="toggle" id="burgerButton">
<i class="fas fa-bars"></i>
</a>
</header>
</div>












share|improve this question
















I have a Navbar which makes a transition when I scroll down.

When I scroll up, the transition doesn't work and I don't know why. Can someone help me resolve this?



The JS code is adding the scrolled class when Math.round($(window).scrollTop()) > 100.






@supports (position: sticky) 
body
padding-top: 0;


header
position: sticky;




.scrolled
transition: 0.5s ease;


.scrolled.header
height: 50px;
background-color: rgba(0, 0, 0, 0.8);
transition: 0.5s ease;


.scrolled.header .header-menu
line-height: 40px;
transition: 0.5s ease;

<div class="block">
<header class="header">
<a href="#" class="header-logo"><i class="fas fa-signal"></i>NAME</a>
<nav class="header-menu">
<a href="#">Accueil</a>
<a href="#">Compétences</a>
<a href="#">Parcours</a>
<a href="#">Projets</a>
<a href="#">Hobbies</a>
<a href="#">Contact</a>
</nav>
<a href="#" class="toggle" id="burgerButton">
<i class="fas fa-bars"></i>
</a>
</header>
</div>








@supports (position: sticky) 
body
padding-top: 0;


header
position: sticky;




.scrolled
transition: 0.5s ease;


.scrolled.header
height: 50px;
background-color: rgba(0, 0, 0, 0.8);
transition: 0.5s ease;


.scrolled.header .header-menu
line-height: 40px;
transition: 0.5s ease;

<div class="block">
<header class="header">
<a href="#" class="header-logo"><i class="fas fa-signal"></i>NAME</a>
<nav class="header-menu">
<a href="#">Accueil</a>
<a href="#">Compétences</a>
<a href="#">Parcours</a>
<a href="#">Projets</a>
<a href="#">Hobbies</a>
<a href="#">Contact</a>
</nav>
<a href="#" class="toggle" id="burgerButton">
<i class="fas fa-bars"></i>
</a>
</header>
</div>





@supports (position: sticky) 
body
padding-top: 0;


header
position: sticky;




.scrolled
transition: 0.5s ease;


.scrolled.header
height: 50px;
background-color: rgba(0, 0, 0, 0.8);
transition: 0.5s ease;


.scrolled.header .header-menu
line-height: 40px;
transition: 0.5s ease;

<div class="block">
<header class="header">
<a href="#" class="header-logo"><i class="fas fa-signal"></i>NAME</a>
<nav class="header-menu">
<a href="#">Accueil</a>
<a href="#">Compétences</a>
<a href="#">Parcours</a>
<a href="#">Projets</a>
<a href="#">Hobbies</a>
<a href="#">Contact</a>
</nav>
<a href="#" class="toggle" id="burgerButton">
<i class="fas fa-bars"></i>
</a>
</header>
</div>






javascript html css






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 27 at 18:26









Al.G.

3,0285 gold badges25 silver badges45 bronze badges




3,0285 gold badges25 silver badges45 bronze badges










asked Mar 27 at 16:25









Nicolas HermosillaNicolas Hermosilla

31 bronze badge




31 bronze badge















  • Hi! Welcome to SO! In order for folks to help they generally appreciate an MCVE to reproduce the behavior describe and fully troubleshoot the issue. As it sits if we can't reproduce the issue then it may be left to assumptions/guessing. As it sits we're note sure what the transition-property is in the first place and it'd difficult to visualize the issue you're describing.

    – Chris W.
    Mar 27 at 16:32

















  • Hi! Welcome to SO! In order for folks to help they generally appreciate an MCVE to reproduce the behavior describe and fully troubleshoot the issue. As it sits if we can't reproduce the issue then it may be left to assumptions/guessing. As it sits we're note sure what the transition-property is in the first place and it'd difficult to visualize the issue you're describing.

    – Chris W.
    Mar 27 at 16:32
















Hi! Welcome to SO! In order for folks to help they generally appreciate an MCVE to reproduce the behavior describe and fully troubleshoot the issue. As it sits if we can't reproduce the issue then it may be left to assumptions/guessing. As it sits we're note sure what the transition-property is in the first place and it'd difficult to visualize the issue you're describing.

– Chris W.
Mar 27 at 16:32





Hi! Welcome to SO! In order for folks to help they generally appreciate an MCVE to reproduce the behavior describe and fully troubleshoot the issue. As it sits if we can't reproduce the issue then it may be left to assumptions/guessing. As it sits we're note sure what the transition-property is in the first place and it'd difficult to visualize the issue you're describing.

– Chris W.
Mar 27 at 16:32












1 Answer
1






active

oldest

votes


















0













If I understand correctly : When you scroll down you add the .scrolled class, and when you move up you remove it ?
If so, you should also add the transition : 0.5s ease; to the nav-bar itself. Because when you remove the .scrolled class, why would a transition occure if the nav haven't this specified in it's css ?






share|improve this answer

























  • Thanks , it's fixed now ! the transition was on my navbar but as "0,5s ease" that's why it didn't work ... my bad.

    – Nicolas Hermosilla
    Mar 27 at 17:09











  • I'm happy it helped you !

    – Hijack_Hornet
    Mar 27 at 17:10










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55382099%2fnavbar-transition-css-trouble%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0













If I understand correctly : When you scroll down you add the .scrolled class, and when you move up you remove it ?
If so, you should also add the transition : 0.5s ease; to the nav-bar itself. Because when you remove the .scrolled class, why would a transition occure if the nav haven't this specified in it's css ?






share|improve this answer

























  • Thanks , it's fixed now ! the transition was on my navbar but as "0,5s ease" that's why it didn't work ... my bad.

    – Nicolas Hermosilla
    Mar 27 at 17:09











  • I'm happy it helped you !

    – Hijack_Hornet
    Mar 27 at 17:10















0













If I understand correctly : When you scroll down you add the .scrolled class, and when you move up you remove it ?
If so, you should also add the transition : 0.5s ease; to the nav-bar itself. Because when you remove the .scrolled class, why would a transition occure if the nav haven't this specified in it's css ?






share|improve this answer

























  • Thanks , it's fixed now ! the transition was on my navbar but as "0,5s ease" that's why it didn't work ... my bad.

    – Nicolas Hermosilla
    Mar 27 at 17:09











  • I'm happy it helped you !

    – Hijack_Hornet
    Mar 27 at 17:10













0












0








0







If I understand correctly : When you scroll down you add the .scrolled class, and when you move up you remove it ?
If so, you should also add the transition : 0.5s ease; to the nav-bar itself. Because when you remove the .scrolled class, why would a transition occure if the nav haven't this specified in it's css ?






share|improve this answer













If I understand correctly : When you scroll down you add the .scrolled class, and when you move up you remove it ?
If so, you should also add the transition : 0.5s ease; to the nav-bar itself. Because when you remove the .scrolled class, why would a transition occure if the nav haven't this specified in it's css ?







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 27 at 16:35









Hijack_HornetHijack_Hornet

814 bronze badges




814 bronze badges















  • Thanks , it's fixed now ! the transition was on my navbar but as "0,5s ease" that's why it didn't work ... my bad.

    – Nicolas Hermosilla
    Mar 27 at 17:09











  • I'm happy it helped you !

    – Hijack_Hornet
    Mar 27 at 17:10

















  • Thanks , it's fixed now ! the transition was on my navbar but as "0,5s ease" that's why it didn't work ... my bad.

    – Nicolas Hermosilla
    Mar 27 at 17:09











  • I'm happy it helped you !

    – Hijack_Hornet
    Mar 27 at 17:10
















Thanks , it's fixed now ! the transition was on my navbar but as "0,5s ease" that's why it didn't work ... my bad.

– Nicolas Hermosilla
Mar 27 at 17:09





Thanks , it's fixed now ! the transition was on my navbar but as "0,5s ease" that's why it didn't work ... my bad.

– Nicolas Hermosilla
Mar 27 at 17:09













I'm happy it helped you !

– Hijack_Hornet
Mar 27 at 17:10





I'm happy it helped you !

– Hijack_Hornet
Mar 27 at 17:10








Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55382099%2fnavbar-transition-css-trouble%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현