一个页面存在多个swipe时,互不影响cancel-ng-swipe-right-on-child Angular Swipe Menu
*{ margin: 0; padding: 0; border: none;}html, body, #page{ height: 100%; min-height: 100%;}.box{ background-color: #EFEFEF; box-shadow: 0 1px 2px #dedede; border: 1px solid #ddd; border-radius: 4px;}.menu{ float: right; min-height:100%; width: 98%;}.menu_item{ line-height:2;}.menu_link{ display:block; padding-left:1em;}.menu_link:hover{ background: #DEDEDE;}.menu-grip{ float:right; height:5em; line-height:.5; padding-top:2em; text-align:center; width:1em;}h1{ background:black; color:white; font-size:1.1em; line-height:1.3;}.big-swiper{ font-size: 5em; height:3em; line-height:3; margin:.5em auto; text-align:center; width:4em;}.big-swiper:before{ content:'<\a0'; color:#dedede; font-weight:700;}.big-swiper:after{ content:'\a0>'; color:#dedede; font-weight:700;}
var app = angular.module('myapp', ['ngTouch']);app.controller('MyCtrl', function MyCtrl($scope) { $scope.stopActions = function (event) { if (event.stopPropagation) { event.stopPropagation(); } // if (event.preventDefault) { // event.preventDefault(); // } // event.cancelBubble = true; // event.returnValue = false; }; // Carousel thing $scope.index = 0; // Hide menu $scope.showMenu = false; // Links $scope.navigation = [{ title: "Page A", href: "#pageA" }, { title: "Page B", href: "#pageB" }, { title: "Page C", href: "#pageC" }]; // Increment carousel thing $scope.next = function () { //stopActions($event); $scope.index++; }; // Decrement carousel thing $scope.prev = function () { //stopActions($event); $scope.index--; };});
转载请备注。