Başka seçenekleriniz varsa, başka bir atlı karıncaya gitmeleri konusunda muhtemelen aynı fikirdeyim. Deneyimlerimden JQuery mobile oldukça düzgün çalışacak, ancak sitem jQuery mobile ile oluşturulmadı ve css'ye ait olan css realiy ile ilgili her şeyi mahvediyor.
<script>
$(document).ready(function() {
$('.carouselresp').carousel({'data-interval': 6000, 'data-pause': "hover"});
var clicking = false;
var currentMousePos = 0;
var newMousePos = 0;
$('.carouselresp img').on('mousedown', function(event) {
clicking = true;
currentMousePos = event.pageX;
});
$('.carouselresp img').on('touchstart', function(event) {
clicking = true;
var touchstart = event.originalEvent.touches[0];
currentMousePos = touchstart.pageX;
});
$(document).on('mouseup', function(event) {
clicking = false;
});
$('.carouselresp img').on('touchend', function(event) {
clicking = false;
});
$(document).on('mousemove', function(event) {
if (!clicking) {
return;
}else {
if (event.pageX < currentMousePos) {
if ((currentMousePos - event.pageX) > 50) {
$('.carouselresp').carousel('next');
clicking = false;
}
} else {
if ((event.pageX - currentMousePos) > 50) {
$('.carouselresp').carousel('prev');
clicking = false;
}
}
}
});
$('.carouselresp img').on('touchmove', function(event) {
var touch = event.originalEvent.touches[0];
if (!clicking) {
return;
}else {
if (touch.pageX < currentMousePos) {
if ((currentMousePos - touch.pageX) > 50) {
$('.carouselresp').carousel('next');
clicking = false;
}
} else {
if ((touch.pageX - currentMousePos) > 50) {
$('.carouselresp').carousel('prev');
clicking = false;
}
}
}
event.preventDefault();
});
});
</script>
çok android ve iphone benim için çalışıyor, artı ben hiçbir dokunmatik desteği
temel sürümü burada bulabilirsiniz
goo.gl/2SIOJj
umut bile tarayıcılarda hareket sağlayan am
TomHre
JQuery Mobile'ı nasıl kullanacağım hakkında daha fazla soru soracağım, henüz başka bir JS çerçevesi eklemekten çekinmeyeceğim, ancak blog yayınınız çok daha fazla ayrıntıya giriyor - teşekkürler! – conradj
Şimdiye kadar TouchSwipe'ı duymamıştım, bu yüzden denedim. Denemenin sadece birkaç dakikasından sonra, TouchSwipe'ın Bootstrap ile güzelce bütünleştiğini buldum, kullanımı basit ve çok hafif. Büyük tavsiye! – CChoma