• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

155
Views
Making elements roll off and another roll in by clicking a button

I have two elements and I want element1 to roll off and element2 will appear. Afterwhich when the button is clicked again, element2 rolls away to reveal element1 using CSS and/or Javascript.

Please use sample contents for these as I have no Html element sample to upload. Thanks

about 3 years ago · Juan Pablo Isaza
1 answers
Answer question

0

All you have to do is create a class with rolling animation style with the help of transform:translate(x, y) rotate(xdeg); and toggle the class in both element1 and element2 with the help of Jquery on click event.

$('.button').click(function(){
    $('.element1').toggleClass('roll-off');
    $('.element2').toggleClass('roll-off');
});
about 3 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error