have a way to add gesture ?

Just starting out? Need help? Post your questions and find answers here.
skinkairewalker
Posts: 120
Joined: Tue Jun 14, 2016 7:17 pm

have a way to add gesture ?

Post 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?
User avatar
Peter
Posts: 1197
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: have a way to add gesture ?

Post 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/
skinkairewalker
Posts: 120
Joined: Tue Jun 14, 2016 7:17 pm

Re: have a way to add gesture ?

Post by skinkairewalker »

with jquery, can I create a kind of SlideShow / Carousel?
User avatar
Peter
Posts: 1197
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: have a way to add gesture ?

Post 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.
skinkairewalker
Posts: 120
Joined: Tue Jun 14, 2016 7:17 pm

Re: have a way to add gesture ?

Post by skinkairewalker »

thanks you very much @Peter
Post Reply