1

This is probably a very simple thing, but I'm very new to Javascript and HTML5 and can't seem to find an answer to my question.

I'm currently developing an app for Samsung Smart TV.

I currently have 2 major files: Main.js and index.html, in which most of my code is written. Also, I have a style sheet called Main.css.

My problem: I have a button the screen, that when pressing it (that is, when pushing enter on the remote), I want the screen to change in to a completely different one (from welcome screen to admin settings). How do I do that??

Hope my question is not too general. Any help would be appreciated.

2

2 Answers 2

1

You should divide your index.html with divs that represent a scene. To make it easy please use Basic Project it will generate a pattern to split the html/css/js like different pages and you only need to call sf.scene.show("SettingsScene")

If you're using javascript project, then the answer from user3384518 is the only way. Like i mentioned above, split your body to several divs and do hide/show the div

0

Your question is clear, but you don't say if you use a library (or not).

So, if you use jQuery :

$('.myButtonName').click(function () {
    $('#myWelcomScreenDiv').hide(200, function () {
        $('#myAdminSettingsDiv').show(200);
    });
});

But, if you would like to do something better, I recommend you to use a framework like Backbone.js or Angular.js.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.