最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Ionic: how to use cssClass in $ionicPopup? - Stack Overflow

programmeradmin5浏览0评论

So I want to modify the default width in $ionicPopup and to do so I have to add 'cssClass' to my popup object just like the code below

  $scope.getScore = function(){
  var popupScore = $ionicPopup.alert({

  title:'Score',
  template: 'Total XP points: 50',
  cssClass: '',
  buttons: [{
    text:'Return',
    type: 'button-assertive'
  }]}}

How would you proceed in this case? Should I give cssClass a value? (i.e: cssClass = 'popupClass') and then go to my CSS file and modify the width from there?

So I want to modify the default width in $ionicPopup and to do so I have to add 'cssClass' to my popup object just like the code below

  $scope.getScore = function(){
  var popupScore = $ionicPopup.alert({

  title:'Score',
  template: 'Total XP points: 50',
  cssClass: '',
  buttons: [{
    text:'Return',
    type: 'button-assertive'
  }]}}

How would you proceed in this case? Should I give cssClass a value? (i.e: cssClass = 'popupClass') and then go to my CSS file and modify the width from there?

Share Improve this question edited Sep 17, 2015 at 18:28 Mudasser Ajaz 6,2571 gold badge27 silver badges29 bronze badges asked Sep 17, 2015 at 17:51 BatziBatzi 3692 gold badges7 silver badges15 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 21

Just define a mother class and override .popup default ionic class inside this way

   .my-custom-popup{
      .popup{
        //styling for popup width, width: 300px;
      }
      .popup-title{
        //styling for title
      }
    }

and pass my-custom-popup in cssClass

 var popupScore = $ionicPopup.alert({

  title:'Score',
  template: 'Total XP points: 50',
  cssClass: 'my-custom-popup',
  buttons: [{
    text:'Return',
    type: 'button-assertive'
  }]}}

Here is the list of classes which you can override or customize in your parent class

  • .popup

  • .popup-head

  • .popup-title

  • .popup-sub-title

  • .popup-body

  • .popup-buttons.row

  • .popup-buttons .button

发布评论

评论列表(0)

  1. 暂无评论