javascript - ionic 模式 - 保持导航栏/菜单可见

标签 javascript jquery angularjs ionic-framework

我想将我的页面放入模态幻灯片中,保持菜单栏静态(例如,当模态打开时,菜单/顶栏不会向上滑动)。

模式幻灯片向上 - 但导航栏/菜单栏应该是白色的。空间已创建(使用 class="has-header"),但它是白色的。

enter image description here

通过单击放大镜,该网站上的模式被激活 - click here 。我尝试制作一个插件但没有成功( here )。

这是我的代码:

打开模式(在我的 .html 中)

<i class="ion-ios-search-strong" ng-click="refineevent()"></i>

我的js的一部分

$ionicModal.fromTemplateUrl('app/components/stores/stores.html', {
    scope: $scope,
    animation: 'slide-in-up'
}).then(function(modal){$scope.modal = modal;});

$scope.refineevent = function(){$scope.modal.show();};

$scope.closeModal = function(){$scope.modal.hide();};


$scope.$on('modal.shown', function(){console.log('Modal is shown!');});

    }

还有我的 modal.html 文件:

<ion-modal-view>
<ion-view name="stores"><ion-pane ng-controller="storesCtrl">

            <ion-content class="has-header">
  ...
        </ion-content>

</ion-view>
</ion-modal-view>

最佳答案

对于模式,您必须创建标题。所以...

<ion-modal-view>
<ion-header-bar>
    <button class="button button-clear icon ion-drag"></button>
    <h1 class="title">LOGO</h1>
    <button class="button button-clear icon ion-hanger"></button>
</ion-header-bar>
    <ion-content>
    </ion-content>
</ion-modal-view>

关于javascript - ionic 模式 - 保持导航栏/菜单可见,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35259434/

相关文章:

javascript - 在 AngularJS 中将 ng-option 重置为 Controller 中的默认值

php - 如何在 ng-bind 中显示选项值?

javascript - jQuery 不在 Rails View 中运行

javascript - 如何从回调函数中设置元素属性

javascript - 在数据表上实现服务器端分页

javascript - 使用 jQuery 水平对齐文本中的图像

javascript - JS split() 正则表达式与单个结果数组的三个匹配

javascript - 为什么 ts-node 不编译 typescript 文件?

jquery - 除了一个元素之外,如何使背景变暗?

javascript - 将脚本值绑定(bind)到 Angular 值时出现问题