top of page
Lanre Olayiwola

Lanre Olayiwola

Header Transition with Velo

  • Jul 17, 2023
  • 1 min read

Updated: Dec 29, 2023

Sometimes, you may want to start your website with one header, then as the user scrolls down, you want a different header. In this post, I will teach you how to use this technique on your sites with a little bit of code.


Of course, I have provided the code below and I specify what needs to be changed to make it work on your sites. Let's get started.

Pressing laptop


$w(‘#transitionStrip’).onViewportLeave(() => {
 	$w(‘#newHeader’).show(“fade”);
 	$w(‘#defaultHeader’).hide(“fade”);

})

$w(‘#transitionStrip’).onViewportEnter(() => {
 	$w(‘#defaultHeader’).show(“fade”);
 	$w(‘#newHeader’).hide(“fade”);

})

The "#transitionStrip" is the strip that you set up to start the transition. The names do not really matter, but you do need to make sure that the names are connected to whatever you named the strips. You do not necessarily need to copy my names.


The "#newHeader" needs to be the header design that the header transitions to after you hit the transition strip.


The "#defaultHeader" needs to be the header at the top of the page before coming into contact with the transition strip.

1 Comment


Hôm qua, mình đang tìm hiểu về một số nền tảng trực tuyến để tham gia học tập online thì tình cờ thấy nhắc đến TG88. Mình lướt qua một vài bài viết và cảm thấy giao diện cũng khá thân thiện, dễ dùng. So với những trang khác mà mình đã thử, TG88 có vẻ trực quan hơn, không bị rối mắt. Tuy nhiên, mình vẫn băn khoăn về chất lượng nội dung và tốc độ tải trang, không biết có ổn định không. Thế nên mình đã bookmark lại để quay lại xem kỹ hơn sau. Hy vọng sẽ tìm được thông tin hữu ích từ đây!

Like
bottom of page