Copy link to clipboard
Copied
Hello,
I need help with writing script, that can assign an action (of show/hide button) to a button. It is supposed to go like this:
For this button
add action -> show/hide button
and hide these set of buttons (which are just selected from the layer panel or from page)
Is it possible, in same script as selection of buttons is involved twice? Also please suggest a way to extend it in a way that an action of show/hide to certain buttons, can be applied to entire array of buttons.
Thanks in advance!
Look for showHideFieldsBehavior property of the button object. For instance, given two buttons, myButton and myOtherButton, the following code hides myOtherButton, and sets the behaviour of myButton to show myOtherButton when you roll over myButton:
myButton.showHideFieldsBehaviors.add ({
enableBehavior: true,
behaviorEvent: BehaviorEvents.MOUSE_ENTER,
fieldsToShow: myOtherButton
});
myOtherButton.hiddenUntilTriggered = true;
P.
Copy link to clipboard
Copied
Look for showHideFieldsBehavior property of the button object. For instance, given two buttons, myButton and myOtherButton, the following code hides myOtherButton, and sets the behaviour of myButton to show myOtherButton when you roll over myButton:
myButton.showHideFieldsBehaviors.add ({
enableBehavior: true,
behaviorEvent: BehaviorEvents.MOUSE_ENTER,
fieldsToShow: myOtherButton
});
myOtherButton.hiddenUntilTriggered = true;
P.
Copy link to clipboard
Copied
Thank you very much! That's exactly what i needed!