Forums

Full Version: Adjust slider range and bar width using script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How to adjust the slider range and bar width of a component by using a script?

Use: to adjust the slider range and bar width.
Script area: connection
Script:
var len=changedItem.attributes.data.length;
var x=sdk.getWidget('timeline56' );
sdk.getWidget( 'timeline56').m_sliderheightratio=4.87;  //sliderheight
if(len>15)
{            
x.m_showslider=true;
var ab=((15*100)/len);
x.m_sliderrange=ab;  //sliderrange
             
}
else{
x.m_showslider=false;
if(changedItem.attributes.data.length<16)
{
x.m_controlbarwidth =40;
x.m_barwidth =40;
}
 
else {
x.m_controlbarwidth =45;
x.m_barwidth = 45;
}
}