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

275
Views
How to parent this range slider with image zooming for website? (HTML/CSS/JavaScript)

I'm using Sublime Text 3 and have been attempting to make this range slider zoom in and out of a website to make it interactive to visitors. The code seems to work here, but not on Sublime Text 3. Are there any tips on how to fix this?

var zoomer = document.getElementById('zoomer');
var spacepic = document.getElementById('spacepic');

function deepdive(){ 
  zoomlevel = zoomer.valueAsNumber;
  spacepic.style.webkitTransform = "scale("+zoomlevel+")";
  pic.style.transform = "scale("+zoomlevel+")";
}
/*Image Test 1*/
#milkyway-container {
  width: 100%;
  font-size: 0;
  border: 1px solid #111;
  overflow: hidden;
  margin: 0 auto;
  margin-top: 2rem;
}

#spacepic {
  width: 100%;
}

#zoomer {
  display: block;
  width: 30%;
  margin: 7rem auto;
}
@media all and (max-width: 500px) {
  #zoomer, #milkyway-container {
    width: 85%;
  }
}
<!DOCTYPE html >  
<html lang="en">  
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>ORIGINS</title>
    <link rel="stylesheet" href="style.css"
    <base href="https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/">
    <script>
        <script src="app.js"></script>
    </script>  
</head>  
<body>
    </div>
  <div id="milkyway-container">
    <img src="https://images.pexels.com/photos/1252890/pexels-photo-1252890.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940" alt="Milkyway Photo" id="spacepic">
    <input type="range" min="1" max="4" value="1" step="0.1" id="zoomer" oninput="deepdive()">
  </div>
</body>  
</html> 

about 4 years ago · Juan Pablo Isaza
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!