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

]]>

14 Commentsto Please tell me how to code this properly

  1. Anonymous says:

    < ![CDATA[

    The correct line you wrote should be


    animate(‘$b’) == 90 ? 90 : 150


    But not sure if that’s what you want

    ]]>

  2. Anonymous says:

    < ![CDATA[

    want the widget to slide down then back up again

    ]]>

  3. Anonymous says:

    < ![CDATA[

    What values does ‘b’ take?

    ]]>

  4. Anonymous says:

    < ![CDATA[

    b is the position ‘top’ binding

    ]]>

  5. Anonymous says:

    < ![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

    ]]>

  6. Anonymous says:

    < ![CDATA[

    Try as event:tap ‘$b == 90 ? 150 : 90


    and as binding animate(‘$b’)

    ]]>

  7. Anonymous says:

    < ![CDATA[

    Thanks for your help, Gonna try it, your a diamond

    ]]>

  8. Anonymous says:

    < ![CDATA[

    Brandon Lawrence​ answer is valid too :) (and easier in this case)

    ]]>

  9. Anonymous says:

    < ![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

    ]]>

  10. Anonymous says:

    < ![CDATA[

    gonna try +Brandons cheers fella

    ]]>

  11. Anonymous says:

    < ![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

    ]]>

  12. Anonymous says:

    < ![CDATA[

    Thanks gonna try. Your a bloody genius

    ]]>

  13. Anonymous says:

    < ![CDATA[

    It works.yay. you truly are a genius. thank you.!

    ]]>

  14. Anonymous says:

    < ![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;

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *