三星电视SDK中的CAPH API小部件
CAPH API widgets in Samsung TV SDK
我做了一个非常简单的CAPH项目,它由一个包含图像的3x3页面组成。当我在图像上focus
时,我希望能够做一些事情。到目前为止,我已经阅读了文档,但无法理解。
我想做的只是在聚焦时减少图像的opacity
。
这是需要编辑的代码:
page1_page.prototype.image_3fzrc_onfocus = function()
{
//should reduce image opacity but don't know how to reference the image
}
谢谢。
PS:我使用了视觉编辑器
编辑:我做了这样的事情,但什么也没发生。
page1_page.prototype.image_3fzrc_onfocus = function()
{
imgspring= caph.wui.widget._Component.getWidgetById("image_3fzrc");
imgspring.setOpacity(0.5);
};
您要做的是:
$(document).ready(function(){
$.caph.focus.activate(function(nearestFocusableFinderProvider, controllerProvider) {
controllerProvider.onFocused(function(event, originalEvent) {
$(event.currentTarget).css({
opacity: 0.5
});
});
});
});
但是,如果你有比图像更多的元素,你可以设置这样的条件,不影响任何元素聚焦,只影响图像:
$(document).ready(function(){
$.caph.focus.activate(function(nearestFocusableFinderProvider, controllerProvider) {
controllerProvider.onFocused(function(event, originalEvent) {
//CONDITION: Just affect to elements with class 'image'
if($(event.currentTarget).attr("class")=== 'image'){
$(event.currentTarget).css({
opacity: 0.5
});
}
});
});
});
相关文章:
- electronic BrowserWindow的最小高度和宽度在hide()show()方法之后不起作用
- Dojo不解析自定义小部件的模板html中的小部件声明性
- 如何更改bigquery API中的计费层选项
- Amazon S3 REST API大小不正确
- 客户端服务器REST API captcha实现
- 在输入字段中将最小金额设置为
- 使用Facebook live API创建实时视频对象时的隐私设置
- 在小部件中使用Facebook API
- 页面可见性 API 在窗口最小化时无法在 Chrome OS X 上运行
- YouTube 数据 API 说,当闲置几个小时时,我已经超过了每日使用限制
- 可嵌入的小部件,使用 JS 滑块显示来自电子商店 API 的产品
- JQuery API 文档生成器,用于打字稿自定义小部件
- 谷歌地图API+Wax.g+IE=小瓷砖
- 如何使用javascript api自定义Youtube上传小部件
- 通过REST API调用获取TFS仪表板小部件ID
- 我可以使用Web API吗?播放按钮小部件的第三方Spotify移动应用程序
- 在小部件api中读取Soundcloud方法
- ESRI JavaScript API -从LocateButton小部件返回坐标
- 三星电视SDK中的CAPH API小部件
- 在Google图表API中设置硬最小轴值