Copy link to clipboard
Copied
I have a Smart Shape that I'm using as an answer button in a custom quiz I created in Captivate 9. In the button, I have the variable reference $$Btn1Label$$. On slide enter, I assign that variable with a literal text value (there are several slides in my quiz, and on enter for each slide it changes the value of Btn1Label to something different.) Some of my answer questions are pretty long, but the text in the button will not wrap when calling the variable. It wraps fine when I put the answer text directly into the button. Does anybody know of a fix for this?
Copy link to clipboard
Copied
You'll have to check the $$Btn1Label$$ character length on the slide enter, look for anything greater than the longest string that will fit on your button (if 10 characters was your cap the expression would be something like "Btn1Label.length > 10"). And if the length exceeds your cap you re-size your button accordingly then add the label to it. I'm guessing that you could set this up as a Cap conditional action? I know my way around Javascript and jQuery but my translation of that to Cap Actions is still sketchy at best. In Javascript you'd grab the element ID and update the CSS properties accordingly but Cap writes cloned and numbered divs for button states so you'd have to know exactly what those names were to be able to get a reference to them in JS.
TL:DR; Check the length of your label value on the slide enter then adjust the size of the button if the string exceeds a certain limit.
-Jord