malsup / cycle2

2nd gen cycling
898 stars 237 forks source link

Change data-cycle-speed value for mobile devices #780

Open csunlab opened 8 years ago

csunlab commented 8 years ago

Hi, I am looking for a simple way to assign a value to data-cycles-speed and data-cycle-timeout based on whether the page is viewed from a mobile. I typically handle these things in css, but it does not work for cycle2, i.e.; .cycle-slideshow { data-cycle-speed=1000;} does not work. I tried adding a script in the html page, but I cannot get to data-cycle-speed, i.e.; I don't know the remaining syntax for getElementsByClassName("cycle-slideshow).??? or getElementsByID("id_name").???. Any tips would help. Thanks!