使用js函数设置Composite Component属性

时间:2014-04-28 15:10:02

标签: javascript html composite-component

我有一个复合组件,它有一个属性可以引用组件的宽度,这个宽度在屏幕大小内变化,所以我有一个Js函数来计算设置该属性的正确值。问题是我不知道如何在Composite组件的属性中设置Js函数;这是我的代码......

<h:form id="formSlider" style="width: 100%">
      <comp:sliderComponent images="#{sliderShowBean.sliderList}"
                slideSpeed="2000" width="#{getContWidth}" />
</h:form>

使用Js功能

    function getContWidth() {
        var width = $("#content_container_wide").css("width");
        return width;
    };

1 个答案:

答案 0 :(得分:0)

相关问题