Looking For help… velo code for collapsible boxes are working perfectly in preview mode but not in published site how to fix it?
Screen elements cannot be accessed outside of the page’s onReady() function. Also, it is incorrect to have more than one onReady() function. You should combine all of your onReady() code into on onReady() and move the lines 1-3 and 22 - 24 to the onReady() function.
Like this?
$w ( “#arrowRight” ). show ()
$w ( “#columnStrip13” ). collapse ()
$w ( “#vectorImage2” ). hide ()
$w ( “#vectorImage1” ). show ()
$w ( “#columnStrip15” ). collapse ()
$w . onReady ( function () {
$w ( “#headerBox1” ). onClick (( event )=>{
if ( $w ( “#columnStrip13” ). collapsed ){
$w ( “#columnStrip13” ). expand ()
$w ( “#arrowDown” ). show ()
$w ( “#arrowRight” ). hide ()
} **else** { $w ( "#columnStrip13" ). collapse ()
$w ( "#columnStrip13" ). show ()
$w ( "#arrowRight" ). show ()
$w ( "#arrowDown" ). hide ()
}
})
$w ( “#box7” ). onClick (( event )=>{
if ( $w ( “#columnStrip15” ). collapsed ){
$w ( “#columnStrip15” ). expand ()
$w ( “#vectorImage2” ). show ()
$w ( “#vectorImage1” ). hide ()
} **else** { $w ( "#columnStrip15" ). collapse ()
$w ( "#columnStrip15" ). show ()
$w ( "#vectorImage1" ). show ()
$w ( "#vectorImage2" ). hide ()
}
})
});
@shahzebaliawan49 As I explained in my previous comment, the following lines must be inside the page’s onReady() :
$w("#arrowRight").show()
$w("#columnStrip13").collapse()
$w("#vectorImage2").hide()
$w("#vectorImage1").show()
$w("#columnStrip15").collapse()
Thank You Now it’s Working