Page 1 of 1
have a way to add gesture ?
Posted: Wed Oct 07, 2020 3:47 am
by skinkairewalker
hello everyone !
have a way to app gesture ?
like this gesture >
https://ionicframework.com/docs/api/slides
move the item from side to side similar to this slider (clicked and moved the mouse or tapped and dragged your finger)
is there an easy way without having to use drawer?
Re: have a way to add gesture ?
Posted: Wed Oct 07, 2020 8:12 am
by Peter
SpiderBasic includes a modified version of jQueryUI, which allows to drag elements. Maybe this meets your requirements?
Code: Select all
EnableExplicit
OpenWindow(0, 0, 0, 0, 0, "Drag-Test", #PB_Window_Background)
ContainerGadget(0, 10, 10, 100, 100, #PB_Container_Single)
TextGadget(1, 10, 10, 80, 30, "Drag me")
CloseGadgetList()
SetGadgetColor(0, #PB_Gadget_BackColor, #Red)
Define GID = GadgetID(0)
! $(v_gid.div).draggable();
More Infos:
https://api.jqueryui.com/draggable/
Re: have a way to add gesture ?
Posted: Wed Oct 07, 2020 12:44 pm
by skinkairewalker
with jquery, can I create a kind of SlideShow / Carousel?
Re: have a way to add gesture ?
Posted: Wed Oct 07, 2020 2:23 pm
by Peter
skinkairewalker wrote:with jquery, can I create a kind of SlideShow / Carousel?
yes, you can. However, there are many libraries that specialise in this.
For example, I think Swiper is quite nice:
https://swiperjs.com/
Code: Select all
EnableExplicit
Define HTML.s
HTML = "<!-- Slider main container -->" +
"<div class='swiper-container' style='width:600px; height:300px; background-color:white'>" +
" <!-- Additional required wrapper -->" +
" <div class='swiper-wrapper'>" +
" <!-- Slides -->" +
" <div class='swiper-slide' style='background-color:red'>Slide 1</div>" +
" <div class='swiper-slide' style='background-color:green'>Slide 2</div>" +
" <div class='swiper-slide' style='background-color:blue'>Slide 3</div>" +
" </div>" +
"</div>"
! $(v_html).appendTo("body");
Procedure Main()
! var mySwiper = new Swiper('.swiper-container', {
! })
EndProcedure
! $("<link rel='stylesheet' href='https://unpkg.com/swiper/swiper-bundle.min.css' />").appendTo("head");
! require(["https://unpkg.com/swiper/swiper-bundle.min.js"], function(s) {
! Swiper = s
Main()
! });
With a little effort you can certainly write a nice SpiderBasic module from it.
Re: have a way to add gesture ?
Posted: Thu Oct 08, 2020 1:51 am
by skinkairewalker
thanks you very much @Peter