See my code: http://jsfiddle.net/NxNXJ/5
The star should be the same size as the sun at this link: http://astro.unl.edu/naap/hr/animations/hrExplorer.html, but this is not happening.
I’m not able to solve this. Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Like this?
Your
calcmethod should multiply val by the size of the sun, so that for example calc(1) returns a width equal to the sun’s width, calc(2) returns a width twice that of the sun, etc.If you want the star to be initialized with the same size as the sun, set the slider’s initial value to 0 and call
showBall(0). This will set the star’s size equal to the sun’s because 10^0 = 1, so the star’s size will be the sun’s size times 1.