【问题标题】:ionicPopup close on tapionicPopup 随时关闭
【发布时间】:2017-04-04 20:43:17
【问题描述】:

我有一个工作的 ionicPopup,它会在时间限制内关闭。是否可以在屏幕上的任何位置单击/双击使其关闭?我知道我可以设置一个关闭按钮,但这并不是我真正需要的。我需要一个简单的关闭方法,我认为点击屏幕更实用。

代码:

  var errorPopup = $ionicPopup.show({
     scope: $scope,
     title: 'Unexpected Error',
     templateUrl: 'error.html'
    });

  $timeout(function() {
   errorPopup.close();
  }, 3000);
}

还有一个问题,我的 html 代码中有一堆超链接标签。但是当我运行我的应用程序时,离子会在每个超链接周围放置一个 1px 的边框。是否可以以某种方式删除“”标签边框。我知道它应该是 CSS 的东西,但我不想修改原始的 ionic 样式,而是更愿意用另一个覆盖该段。有大佬可以帮忙吗?

解决方案:(Link)

<div class="col text-center">
  <a class="item dash-link" id="link" href="#" onclick="window.open('http://www.example.com', '_blank', 'location=no'); return false;">
  <img ng-src="img/icons/example.png" height="80" width="80"></a>
  <br>
  GMail
</div>

CSS:

#link {
    text-decoration:none;
    border:0;
    outline:none;
}

【问题讨论】:

    标签: css angularjs ionic-framework


    【解决方案1】:

    This is a service 实现此行为。

    安装

    用凉亭安装它

    $ bower install ionic-close-popup
    

    在应用的依赖项中包含 ionic.closePopup 模块:

    angular.module('app', ['ionic', 'ionic.closePopup'])
    

    用法

    将您新创建的弹出窗口注册到 closePopupService 服务:

     var alertPopup = $ionicPopup.alert({
          title: 'Alert popup',
          template: 'Tap outside it to close it'
     });
     IonicClosePopupService.register(alertPopup);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-12-08
      • 2017-05-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多