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

215
Views
Why doesn’t my button work when it’s hidden?

I have some code here it is

function setup() {
  createCanvas(1350, 715);
  var blueskin = createButton('BLUE')
  blueskin.mousePressed(changeblue)
  blueskin.position(100,400)
  blueskin.size(50,50)
  blueskin.style('display:none')
}
function changeblue(){
  playercolr='blue'
}
<script src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/p5.js"></script>

When the button is not hidden it works perfectly but whenever I change it to hidden it stops working I looked some stuff up and aren’t buttons supposed to work even if hidden

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Change the style from 'display:none' to 'visiblity: hidden' and then try it

visibility:hidden hides the element

display:none removes the element from the document

about 4 years ago · Juan Pablo Isaza Report

0

Try:

blueskin.style('display', 'none')

per p5js documentation: https://p5js.org/reference/#/p5.Element/style

The syntax should be style(property, value) rather than style(propertyAndValue)

about 4 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 Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!