The background color does not change.
I am looking for a way to add some animation using the “wix js”. But I did not find a way to add a class nor an ID. So I try to simply change the background which does not work…
The background color does not change.
I am looking for a way to add some animation using the “wix js”. But I did not find a way to add a class nor an ID. So I try to simply change the background which does not work…
Did you run onViewportLeave for #anchor4?
A connection to the PROPERTY-PANEL in this case is → NOT ← needed!
Since the event gets fired from onReady-Code-Part!
Test your code and its function generating another example first!
Setting the opacity back to transparent!
$w('#button1').style.backgroundColor = "rgba(255,255,255, 0)";
$w.onReady(()=>{
$w('#button1').style.backgroundColor = "rgba(255,255,255, 0)";
$w('#button1').onClick(()=>{console.log("button clicked!")
$w('#button1').style.backgroundColor = "blue";
});
});
Another version: RGB
$w.onReady(()=>{
$w('#button1').onClick(()=>{console.log("button clicked!")
$w('#button1').style.backgroundColor = "rgb(155,245,155)";
});
});
Another version: RGBA
$w.onReady(()=>{
$w('#button1').onClick(()=>{console.log("button clicked!")
$w('#button1').style.backgroundColor = "rgba(155,245,155, 0.5)";
});
});