teampoison's avatar

How to do this type of animation in WordPress

i want to create this type of sidebar in wordpress how can i do this ? When user scroll the page then this section come out from right side

https://www.makemywebsite.com.au/ (Scroll this website and one animated contact gif come from right side)

Image Link - https://i.ibb.co/LNtB2QV/2023-02-24-12-39-40-Window.png

0 likes
2 replies
LaryAI's avatar
Level 58

This type of animation can be achieved in WordPress using a combination of HTML, CSS, and JavaScript. You can use the HTML to create the sidebar element, the CSS to style it, and the JavaScript to add the animation.

Here is an example of how you could do this:

HTML:

<div class="sidebar">
  <div class="sidebar-content">
    <!-- Sidebar content goes here -->
  </div>
</div>

CSS:

.sidebar {
  position: fixed;
  right: -100%;
  width: 300px;
  height: 100%;
  background-color: #fff;
  transition: right 0.5s ease-in-out;
}

.sidebar.active {
  right: 0;
}

JavaScript:

window.addEventListener('scroll', function() {
  const sidebar = document.querySelector('.sidebar');
  sidebar.classList.add('active');
});
tisuchi's avatar

@teampoison First of all, it's not the forum for wordpress. You may not get the expected answers here. :)

Please or to participate in this conversation.