Hello everyone, I would like to know if there is any way to animate the movement of gadgets between a specific X,Y point to another specific X,Y point
like this >
is there any way to animate gadget movement ?
-
- Posts: 120
- Joined: Tue Jun 14, 2016 7:17 pm
Re: is there any way to animate gadget movement ?
You can use jQuery.animate():
Code: Select all
Enumeration
#Window
#Card
EndEnumeration
Procedure CardEvent()
Static newX = 10
Protected GID = GadgetID(#Card)
If newX = 10
newX = WindowWidth(#Window) - GadgetWidth(#Card) - 10
Else
newX = 10
EndIf
! $(v_gid.div).animate({ left: so_cardevent$v_newx + "px" }, 1000 ); // -> https://api.jquery.com/animate/
EndProcedure
OpenWindow(#Window, 0, 0, 1000, 200, "", #PB_Window_ScreenCentered)
ContainerGadget(#Card, 10, 10, 180, 180) : CloseGadgetList()
SetGadgetColor(#Card, #PB_Gadget_BackColor, #Red)
GID = GadgetID(#Card)
! $(v_gid.div).click(f_cardevent);
-
- Posts: 120
- Joined: Tue Jun 14, 2016 7:17 pm
Re: is there any way to animate gadget movement ?
Awesome !!
thanks you very much Peter
thanks you very much Peter
but on this line > what means " so_cardevent " ? it shouldn't be f_cardevent, because cardevent() is a procedure?Peter wrote: ↑Sat Jun 12, 2021 1:00 pmCode: Select all
! $(v_gid.div).animate({ left: so_cardevent$v_newx + "px" }, 1000 ); // -> https://api.jquery.com/animate/
Re: is there any way to animate gadget movement ?
so_cardevent$v_newx is the 'internal' JavaScript-Name of the static newX -Variableskinkairewalker wrote: ↑Sat Jun 12, 2021 3:22 pmbut on this line > what means " so_cardevent " ? it shouldn't be f_cardevent, because cardevent() is a procedure?
-> so_[SB-Procedurename]$v_[SB-StaticVariablename}
-
- Posts: 120
- Joined: Tue Jun 14, 2016 7:17 pm
Re: is there any way to animate gadget movement ?
wow, amazing.
living and learning !!
thank you so much !!!!
living and learning !!
thank you so much !!!!