Comments (1)
I realize this is an old question but I figured I'd throw out how I added button controls. Someone may find it useful someday.
I had a long swipe and wanted bookmarks at the bottom to jump to different pages.
I used jquery to locate the carousel, since it renames it and you lose your IDs.
I put it in a div called "swiper" and used that as my starting point. the carousel will be placed in a unnamed div. I suppose if you have one carousel on a page you could add code to the carousel script to add an id to the div or ul.
on my buttons I added a function that passes a number and calculates the new left CSS, which if you what the code in a browser inspector is the number that changes. I multiple the -width of a single page by the passed number. if I want page 1 i pass a 0, page 3 is 2, etc.
function jumper(c){
var distance = -1910 * c;
var myCarousel = $("div#swiper > div:first > ul:first");
console.log(myCarousel.width());
myCarousel.css("left", distance +"px");
}
for just next and previous you could set a variable at 0 and onclick of next add a +1 and pass it to a similar function.
from jquerymobile-carousel.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquerymobile-carousel.