JIT
Toggling view all with div width animation
<div class="cv-homepage-contentsec-headerwrap-rhs center"> <div class="cv-homepage-contentsec-viewall" id="toggleViewBtn" aria-pressed="false">View All</div> <div class="cv-homepage-contentsec-navwrap center"> <div id="prevBtn" class="cv-homepage-contentsec-nav-leftbtn center tooltip-bottom cv-leftarr" tooltip-title="Previous" aria-disabled="false"></div> <div id="nextBtn" class="cv-homepage-contentsec-nav-rightbtn center tooltip-bottom cv-rightarr" tooltip-title="Next" aria-disabled="false"></div> </div> </div> 1. On toggle View All/ Collapse happens juz by extending the div width from 122px to 264px for view All / Collapse and navwrap div should hide to right and back on toggling this

Which file contains this HTML snippet? Do you have an existing JavaScript file for handling this toggle, or should I add inline script to the HTML?

just css animation for toggling

What is the path to the CSS file where I should add these animation styles?

juz rough
Write file
Added rough CSS for toggle animation
v1

.toggle-animation.css

.cv-homepage-contentsec-headerwrap-rhs { overflow: hidden; transition: all 0.3s ease; }

.cv-homepage-contentsec-viewall { width: 122px; transition: width 0.3s ease; cursor: pointer; }

.cv-homepage-contentsec-viewall.toggled { width: 264px; }

.cv-homepage-contentsec-navwrap { position: absolute; right: 0; top: 0; transition: transform 0.3s ease; }

.cv-homepage-contentsec-headerwrap-rhs.toggled .cv-homepage-contentsec-navwrap { transform: translateX(142px); /* Hide to the right by the difference in width */ }

.cv-homepage-contentsec-headerwrap-rhs.toggled { width: 264px; /* Adjust wrapper width as needed */ }

sample demo
Write file
Created demo HTML for toggle animation
v2
<div class="cv-homepage-contentsec-headerwrap-rhs center"> <div class="cv-homepage-contentsec-viewall" id="toggleViewBtn" aria-pressed="false">View All</div> <div class="cv-homepage-contentsec-navwrap center"> <div id="prevBtn" class="cv-homepage-contentsec-nav-leftbtn center tooltip-bottom cv-leftarr" tooltip-title="Previous" aria-disabled="false"></div> <div id="nextBtn" class="cv-homepage-contentsec-nav-rightbtn center tooltip-bottom cv-rightarr" tooltip-title="Next" aria-disabled="false"></div> </div> </div> 1. On toggle View All/ Collapse happens juz by extending the div width to right alone for view All / Collapse and navwrap div should hide to right and back on toggling this

#viewall { width: 122px; transition: width 0.3s ease; cursor: pointer; }

#viewall.toggled { width: 264px; }

.navwrap { transition: transform 0.3s ease; }

.toggled .navwrap { transform: translateX(142px); }

.wrapper { transition: width 0.3s ease; width: 122px; }

.wrapper.toggled { width: 264px; }

alternate

What kind of alternate solution do you want? (e.g., JavaScript toggle instead of CSS, or different animation approach?)

animation correct but not working for my case

What part isn't working? Can you share the file path or more details?

<div class="cv-homepage-contentsec-headerwrap"> <div class="cv-homepage-contentsec-header-title"> A Vertical Collaboration &amp; Engagement Platform </div> <div class="cv-homepage-contentsec-header-separator"> </div> <div class="cv-homepage-contentsec-headerwrap-rhs center"> <!--div class="cv-homepage-contentsec-collapse dN"> Collapse </div--> <div class="cv-homepage-contentsec-viewall" id="toggleViewBtn" aria-pressed="false">View All</div> <div class="cv-homepage-contentsec-navwrap center"> <div id="prevBtn" class="cv-homepage-contentsec-nav-leftbtn center tooltip-bottom cv-leftarr" tooltip-title="Previous" aria-disabled="true"></div> <div id="nextBtn" class="cv-homepage-contentsec-nav-rightbtn center tooltip-bottom cv-rightarr" tooltip-title="Next" aria-disabled="false"></div> </div> </div> </div> css: .cv-homepage-contentsec-headerwrap { display: flex ; justify-content: space-between; align-items: center; } .cv-homepage-light .cv-homepage-contentsec-header-separator { background-color: #F0F0F0; height: 1px; flex: 1; margin: 0 22px 0 32px; width: 432px; } #viewall { width: 122px; transition: width 0.3s ease; cursor: pointer; } #viewall.toggled { width: 264px; } .navwrap { transition: transform 0.3s ease; } .toggled .navwrap { transform: translateX(142px); } .wrapper { transition: width 0.3s ease; width: 122px; } .wrapper.toggled { width: 264px; }
Write file

JavaScript to toggle the class (add to your JS file or inline in HTML):

const toggleBtn = document.getElementById('toggleViewBtn');
const rhsWrapper = document.querySelector('.cv-homepage-contentsec-headerwrap-rhs');

toggleBtn.addEventListener('click', () => {
    rhsWrapper.classList.toggle('toggled');
});

Link the new CSS file and add this JS to your existing setup. Adjust widths or transforms as needed for layout.

Updated files
v3