Search code examples
webosenyo

How can i put image in webOS application


i want to add image in the webos application and want to add click event for it. i am also not able to put background image in the application. i put this code to set background image in Basic.css file

body.palm-default {
    background: url('../images/comman_bg.png') top left no-repeat;
    z-index: -1;
    position: fixed;
    top: 0px;
    left: 0px;
    width: 320px;
    height: 480px;
}
/* "splash" below is the scene name. Replace it with your scene name to get it to have a custom background */
#mojo-scene-splash-scene-scroller {
    background: url('../images/splash-screenshot-default.png') top left no-repeat;
}

if anyone have code for set image and click event for image then reply.


Solution

  •    // set up the image view widget
       this.tfdImages = this.controller.get("tfd-images");
       this.tfdWidget = this.controller.setupWidget("tfd-images", {noExtractFS: true}, this.imageModel = 
                               {
                                  onLeftFunction: function() { this.updateImages(-1); }.bind(this),
                                  onRightFunction: function() { this.updateImages(1); }.bind(this)
                               });