Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

145
Views
I need help creating a div that scales to the size of the page after a button is clicked

Essentially I have a button on my page, and I want a div with content (videos, text, etc.) inside of it. My goal is to create the div and when the button is clicked, it will scale up from the center of the button and cover the current content on the screen. I can easily add a border-radius css to make it start as a circle but then turn into the rectangle that engulfs the window.

It's a bit of a complicated request I know, but I can't find any tutorials online for something even remotely similar to this concept. I originally found this idea on the following site: http://christophe-kerebel.com/ if that helps you get an idea of what I am trying to make.

Thanks in advance! (:

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

For others who may be confused, when you go to the site you need to click one of the links on the bottom to see the expanding circle OP is referring to. Not sure exactly what you are asking for, but I think the key to what you are asking are css transitions.

Set the size of the div and a transition property through css

#myDiv{
        width: 10px;
        transition: width 5s ease;
      }

With the transition property set, once the specified 'width' transition property changes, it will slowly transition to the new size using the specified time interval, in this example 5 seconds. You can toggle the width using javascript, something like document.getElementById("myDiv").style.width = "500px"; Thats most likely triggered by the button click.

 <button onClick="document.getElementById('myDiv').style.width = '500px' ">Expand</button>

Its also worth noting that you can add the transition effect to virtually any css style, not just width and height, but color, position, etc

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!