Please tell me how to code this properly
Please tell me how to code this properly
animate(‘$b’==90 ? 90 : 150)
want to toggle b variable over,maybe 500ms
thankyou
]]>« In app drawer, after tap to visibility is show three opting. All, only hidden, only visible. (Previous Post)
(Next Post) In app drawer, my drawer, hierarchy… »
< ![CDATA[
The correct line you wrote should be
animate(‘$b’) == 90 ? 90 : 150
But not sure if that’s what you want
]]>
< ![CDATA[
want the widget to slide down then back up again
]]>
< ![CDATA[
What values does ‘b’ take?
]]>
< ![CDATA[
b is the position ‘top’ binding
]]>
< ![CDATA[
Ah, I understand.
You are doing it incorrectly.
The toggle can’t have the animate function. Just a $b==0?1:0
The binding is where you should put the animate with the animation time, animate(‘$b’,500)*(150-90)+90
]]>
< ![CDATA[
Try as event:tap ‘$b == 90 ? 150 : 90
and as binding animate(‘$b’)
]]>
< ![CDATA[
Thanks for your help, Gonna try it, your a diamond
]]>
< ![CDATA[
Brandon Lawrence answer is valid too :) (and easier in this case)
]]>
< ![CDATA[
I’ve not worded it correctly, I would like it to automatically toggle
between both positions after only tapping variable set once as to give it a
sliding up and down movement, basically springing back into place
]]>
< ![CDATA[
gonna try +Brandons cheers fella
]]>
< ![CDATA[
Ok, use this.
Toggle:
1-$b
Binding:
var ab=animate(‘$b’,500);
if(ab==1)setTimeout(function(){LL.setVariableInteger(“$b”,0);},0);
return ab*(150-90)+90
]]>
< ![CDATA[
Thanks gonna try. Your a bloody genius
]]>
< ![CDATA[
It works.yay. you truly are a genius. thank you.!
]]>
< ![CDATA[
If you like the solution I gave you, leave it.
But if you find any problem, for example that the item is at the wrong position after restart or when clicking it ‘jumps’, try this improved suggestion:
[edit] with this you can change the time it takes to open, the time it is opened, and the time it takes to close. If you want so tell me, otherwise this code has 500 by default
Toggle:
1-$b
Binding:
Math.abs(animate(‘$b’,500)-animate(‘$b’,500,”ad”,500))*(150-90)+90;
]]>