如何将图像放入 webOS 应用程序中
我想在 webos 应用程序中添加图像并为其添加单击事件。我也无法将背景图像放入应用程序中。 我将此代码放在 Basic.css 文件中设置背景图像。
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;
}
如果有人有设置图像的代码并单击图像事件然后回复,
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否确定包含了index.html 中的Basic.css 文件?您是否确保图像的路径相对于 CSS 文件的位置是正确的?
要为图像设置点击处理程序,您需要执行如下操作:
稍后您需要停止监听
Did you make sure to include the Basic.css file from your index.html? Did you make sure the path to the images was correct, relative the placement of the CSS file?
To set a click handler for an image you'll want to do something like the following:
And later you'll want to stop listening