What's new

Web Javascript homework help

  • Thread starter Lucifers Dog
  • Start date
  • Views 303
Lucifers Dog

Lucifers Dog

Enthusiast
Messages
318
Reaction score
83
Points
150
So I finished all my assignment except the last part. If anyone can help out that would be great. The part that I don't get it the section where it says to add an on-load method.

My assignment can be found here:

[Click here to view this link]

Thanks.
 
Y

YYes

Enthusiast
Messages
177
Reaction score
52
Points
85
Code:
app.Screen.prototype.hide = function() {
this.getDiv().style.display = 'none';
};
idk
 
Lucifers Dog

Lucifers Dog

Enthusiast
Messages
318
Reaction score
83
Points
150
Code:
app.Screen.prototype.hide = function() {
this.getDiv().style.display = 'none';
};
idk


Thanks so I guess after this code I should rewrite the show function to use the Hide function right?
 
Y

YYes

Enthusiast
Messages
177
Reaction score
52
Points
85
Well, that's the thing, I'm not sure where to call that function. Maybe in the div's onload?
Code:
<div onload="app.Screen.prototype.hide()">

And apparently onload is censored, but on-load isn't.
 
Lucifers Dog

Lucifers Dog

Enthusiast
Messages
318
Reaction score
83
Points
150
Well, that's the thing, I'm not sure where to call that function. Maybe in the div's ******?
Code:
<div ******="app.Screen.prototype.hide()">

And apparently ****** is censored, but on-load isn't.


So I just had to create the hide function like the one you listed and then just implement it into the show method. Was simpler than I thought. Thanks for the help.
 
Top Bottom
Login
Register