APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

HowTo use Checkboxes post and replies

Return to the HowTo use Checkboxes thread
Login to post to this thread

How to use Checkboxes
Klaus-Dieter Grueninger
2 Posts

Hi there,

I am currently working on an optics project and I wonder how I can use
Checkboxes to determine the visibility on an element.

I assume it is quite simple, but I have no clue how to do it.

Can you name any EJSS in Javascript where this has been done so I can see
how to implement it?

Thanks

Klaus-Dieter


Replies to How to use Checkboxes

Re: How to use Checkboxes -
lookang Avatar
lookang
245 Posts

Yes it is easy.

Set the drawing element visible option to a variable say showWhatever  to make objects appear and disappear when the Boolean showWhatever is control in the checkbox.

Example
http://iwant2study.org/ospsg/index.php/interactive-resources/physics/04-waves/04-light/116-thinlenmodel05

Post edited June 4, 2017 at 7:00 PM EST.


OSP@SG blog
OSP@SG Digital Library


OSP Projects:
Open Source Physics - EJS Modeling
Tracker
Physlet Physics
Physlet Quantum Physics
STP Book