Framework7 - Overswipe
Descripción
La acción de sobrepasar se activa automáticamente cuando desliza demasiado. La siguiente lista describe algunos puntos más sobre un barrido excesivo .
El sobredeslizamiento se puede aplicar a un botón de acción usando la clase de deslizamiento-sobredeslizamiento .
Solo se puede usar en el último botón de deslizar hacia la derecha y solo en el primer botón en las acciones de deslizar hacia la izquierda.
Debe agregar el detector de eventos apropiado al botón de desplazamiento excesivo.
Durante el sobredeslizamiento, la clase de deslizamiento-sobredeslizamiento-activo se agregará al botón de sobredeslizamiento, que se puede usar para un estilo adicional.
Ejemplo
El siguiente ejemplo muestra los elementos si hay demasiadas acciones de deslizamiento mediante el uso del exceso de deslizamiento en Framework7:
<!DOCTYPE html>
<html>
<head>
<meta name = "viewport" content = "width = device-width, initial-scale = 1,
maximum-scale = 1, minimum-scale = 1, user-scalable = no, minimal-ui" />
<meta name = "apple-mobile-web-app-capable" content = "yes" />
<meta name = "apple-mobile-web-app-status-bar-style" content = "black" />
<title>Overswipe</title>
<link rel = "stylesheet"
href = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/css/framework7.ios.min.css" />
<link rel = "stylesheet"
href = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/css/framework7.ios.colors.min.css" />
</head>
<body>
<div class = "views">
<div class = "view view-main">
<div class = "pages">
<div data-page = "home" class = "page navbar-fixed">
<div class = "navbar">
<div class = "navbar-inner">
<div class = "left"> </div>
<div class = "center">Swipe To Delete</div>
<div class = "right"> </div>
</div>
</div>
<div class = "page-content">
<div class = "list-block media-list">
<ul>
<li class = "swipeout">
<div class = "swipeout-content">
<a href = "#" class = "item-content item-link">
<div class = "item-inner">
<div class = "item-title-row">
<div class = "item-title">Amayon</div>
<div class = "item-after">7:10</div>
</div>
<div class = "item-subtitle">Your order has been shipped</div>
<div class = "item-text">Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim
lacus tincidunt.</div>
</div>
</a>
</div>
<div class = "swipeout-actions-left"><a href = "#" class = "swipeout-overswipe bg-pink reply">Reply</a><a href = "#" class = "bg-blue forward">Forward</a></div>
<div class = "swipeout-actions-right"><a href = "#" class = "mark bg-lightblue">Spam</a><a href = "#" class = "swipeout-delete swipeout-overswipe">Delete</a></div>
</li>
<li class = "swipeout">
<div class = "swipeout-content">
<a href = "#" class = "item-content item-link">
<div class = "item-inner">
<div class = "item-title-row">
<div class = "item-title">VodafoneZone</div>
<div class = "item-after">10:15</div>
</div>
<div class = "item-subtitle">Bill Payments</div>
<div class = "item-text">Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim
lacus tincidunt.</div>
</div>
</a>
</div>
<div class = "swipeout-actions-left"><a href = "#" class = "swipeout-overswipe bg-pink reply">Reply</a><a href = "#" class = "bg-blue forward">Forward</a></div>
<div class = "swipeout-actions-right"><a href = "#" class = "mark bg-lightblue">Spam</a><a href = "#" class = "swipeout-delete swipeout-overswipe">Delete</a></div>
</li>
<li class = "swipeout">
<div class = "swipeout-content">
<a href = "#" class = "item-content item-link">
<div class = "item-inner">
<div class = "item-title-row">
<div class = "item-title">Popular in your network</div>
<div class = "item-after">19:14</div>
</div>
<div class = "item-subtitle">New messages from John Doe</div>
<div class = "item-text">Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim
lacus tincidunt.</div>
</div>
</a>
</div>
<div class = "swipeout-actions-left"><a href = "#" class = "swipeout-overswipe bg-pink reply">Reply</a><a href = "#" class = "bg-blue forward">Forward</a></div>
<div class = "swipeout-actions-right"><a href = "#" class = "mark bg-lightblue">Spam</a><a href = "#" class = "swipeout-delete swipeout-overswipe">Delete</a></div>
</li>
<li class = "swipeout">
<div class = "swipeout-content">
<a href = "#" class = "item-content item-link">
<div class = "item-inner">
<div class = "item-title-row">
<div class = "item-title">Adam WillSmith</div>
<div class = "item-after">22:44</div>
</div>
<div class = "item-subtitle">Car Insurance renewal</div>
<div class = "item-text">Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim
lacus tincidunt.</div>
</div>
</a>
</div>
<div class = "swipeout-actions-left"><a href = "#" class = "swipeout-overswipe bg-pink reply">Reply</a><a href = "#" class = "bg-blue forward">Forward</a></div>
<div class = "swipeout-actions-right"><a href = "#" class = "mark bg-lightblue">Spam</a><a href = "#" class = "swipeout-delete swipeout-overswipe">Delete</a></div>
</li>
<li class = "swipeout">
<div class = "swipeout-content">
<a href = "#" class = "item-content item-link">
<div class = "item-inner">
<div class = "item-title-row">
<div class = "item-title">Twitter</div>
<div class = "item-after">23:22</div>
</div>
<div class = "item-subtitle">Follow Vivekananda Fans and Bill Gates</div>
<div class = "item-text">Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim
lacus tincidunt.</div>
</div>
</a>
</div>
<div class = "swipeout-actions-left"><a href = "#" class = "swipeout-overswipe bg-pink reply">Reply</a><a href = "#" class = "bg-blue forward">Forward</a></div>
<div class = "swipeout-actions-right"><a href = "#" class = "mark bg-lightblue">Spam</a><a href = "#" class = "swipeout-delete swipeout-overswipe">Delete</a></div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<script type = "text/javascript"
src = "https://cdnjs.cloudflare.com/ajax/libs/framework7/1.4.2/js/framework7.min.js"></script>
<script>
var myApp = new Framework7();
var $$ = Dom7;
$$('.mark').on('click', function () {
myApp.alert('Spam');
});
$$('.reply').on('click', function () {
myApp.alert('Reply');
});
$$('.forward').on('click', function () {
myApp.alert('Forward');
});
</script>
</body>
</html>
Salida
Realicemos los siguientes pasos para ver cómo funciona el código dado anteriormente:
Guarde el código HTML proporcionado anteriormente como list_views_swipe_basic.html archivo en la carpeta raíz de su servidor.
Abra este archivo HTML como http: //localhost/list_views_swipe_basic.html y la salida se muestra como se muestra a continuación.
Este ejemplo desencadena una acción de deslizamiento excesivo automáticamente cuando se desliza demasiado y el script activará automáticamente el evento "clic" en el botón de desplazamiento excesivo.