admin管理员组文章数量:1278985
How do you disable the drag function on an ionic side menu? I am pretty new to this and need help. When I swipe right on the main page... it opens up a menu and I don't want this to happen. Here is my current code:
<!-- Side menu -->
<ion-side-menu side="left" drag-content="false">
<ion-header-bar class="bar-dark">
<h1 class="title">Cards</h1>
</ion-header-bar>
<ion-content scroll="true">
</ion-side-menus>
Javascript:
$scope.$root.canDrag = false;
How do you disable the drag function on an ionic side menu? I am pretty new to this and need help. When I swipe right on the main page... it opens up a menu and I don't want this to happen. Here is my current code:
<!-- Side menu -->
<ion-side-menu side="left" drag-content="false">
<ion-header-bar class="bar-dark">
<h1 class="title">Cards</h1>
</ion-header-bar>
<ion-content scroll="true">
</ion-side-menus>
Javascript:
$scope.$root.canDrag = false;
Share
Improve this question
asked Nov 4, 2014 at 9:41
GarrettGarrett
2613 gold badges7 silver badges16 bronze badges
1
- You asked the same question before. Please remove it 1st. I suggest you also ask this question on Ionic Developer forum: forum.ionicframework. – Maxim Shoustin Commented Nov 4, 2014 at 9:48
2 Answers
Reset to default 8Drag-content attribute must be written over tag.
For e.g :
<ion-side-menu side="left">
<ion-pane ion-side-menu-content drag-content="false">
<ion-header-bar class="bar-dark">
<h1 class="title">Cards</h1>
</ion-header-bar>
<ion-content scroll="true">
</ion-content>
</ion-pane>
</ion-side-menus>
This will do the job. !!
Edit :
To Create a Menu Close Button, add the attribute menu-toggle="menu_side" to the button.
E.g
<button menu-toggle="right" class="button transparent button-icon icon ion-navicon"></button>
You can disable drag side menu, for example on login page where you don't want side menu to be visible.
(function () {
'use strict';
angular
.module('myApp')
.controller('LoginCtrl', [
'$scope',
'$log',
'$ionicSideMenuDelegate',
LoginFunction]);
function LoginFunction($scope, $log, $ionicSideMenuDelegate) {
var vm = this;
$log.debug('its working');
$ionicSideMenuDelegate.canDragContent(false)
}
}());
本文标签: javascriptHow do you disable the drag function on an ionic side menuStack Overflow
版权声明:本文标题:javascript - How do you disable the drag function on an ionic side menu? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741224260a2361559.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论