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

107
Views
downscale image by 5 pixels onmousedown

I am in school and the objective I am missing is to rescale the mole1 element by 5 pixels on mouse click (onmousedown) then to have the image rescale to original scale when mouse button releases (onmouseup). I added comments where i think the functions for it would go.

//html below

<html>
    <head>
       
    </head>
    <Body>
        <img id="mole" src="./Images/montymole-idle1.png">
        <img id="luigi" src="./Images/luigi-wack1.png">
        <p id="text">Times Hit Mole</p> 
        
       

        <script language="javascript"
        type="text/javascript" src="./script.js/Script.js">

    </script>
    </Body>
</html>


//JavaScript extention below


var luigi1 = document.getElementById("luigi")
var mole1 = document.getElementById("mole")
var count = 0
var text = document.getElementById("text")



luigi1.onmousedown = function(){
   luigi1.src=("./Images/luigi-wack2.png")
   mole1.src=("./Images/montymole-idle2.png")
   count ++
   text.textContent = "hits:" + count;
   //HOW DO I DOWNSCALE IMAGE (var mole1) BY 5 PIXLES ONMOUSEDOWN
}
luigi1.onmouseup = function(){
    luigi1.src = ("./Images/luigi-wack1.png")
    mole1.src = ("./Images/montymole-idle1.png")
   //HOW DO I RESCALE IMAGE (var mole1) TO ORIGONAL FORM ONMOUSEUP
}
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!