Home > Web Front-end > JS Tutorial > body text

Detailed explanation of ionic custom pop-up box examples

零下一度
Release: 2017-06-28 13:23:27
Original
2045 people have browsed it

This article mainly introduces the ionic custom pop-up effect, which is very good and has reference value. Friends who need it can refer to it

Customized pop-ups are often needed during the work process. Therefore, the content is organized as follows to facilitate learning. If there is anything inappropriate, please correct me!

Ideas

  • Use the pop-up box $ionicPopup that comes with ionic.

  • Hide the head and tail and keep only the body part

  • Use templateUrl or template to introduce the required template

Code


$ionicPopup.show({
    cssClass:'team-popup',
    template: "<p class=&#39;list popup-form&#39;>" +
    "<p class = &#39;form-title&#39;>{{tempItem.name}}</p>" +
    "<p class=&#39;form-content&#39;>" +
     "<p class=&#39;input-name&#39;>input1:</p>" +
     "<p class=&#39;input-area&#39;><input type=&#39;number&#39; placeholder=&#39;10.00&#39; ng-model=&#39;tempItem.input1&#39;></p>" +
    "</p>" +
    "<p class=&#39;form-content&#39;>" +
     "<p class=&#39;input-name&#39;>input2:</p>" +
     "<p class=&#39;input-area&#39;><input type=&#39;number&#39; ng-model=&#39;tempItem.input2&#39;></p>" +
    "</p>" +
    "<p class=&#39;form-button&#39;>" +
     "<button class=&#39;button wyl-left-button&#39; ng-click=&#39;fnClosePopup()&#39; >cancel</button>" +
     "<button class=&#39;button wyl-right-button&#39; ng-click=&#39;fnExchangeGoods()&#39; >submit</button>" +
    "</p>" +
    "</p>",
    scope: $scope
   });
Copy after login


/**弹出窗popup 无titlecss*/
.team-popup .popup-head{
 display: none;
}
.team-popup .popup{
 padding: 0;
 -moz-border-radius: 5px;
 -webkit-border-radius: 5px;
 border-radius:5px;
}
.team-popup .popup-body{
 padding: 0;
 /*overflow-y:scroll;*/
}
/*自定义表单*/
.popup-form{
 font-size:15px
}
.form-title{
 margin: 10px;
 text-align:center
}
.form-content{
 width: 90%;
 height: 36px;
 background-color: white;
 padding-left: 10px;
 margin:10px auto;
 position: relative;
 border-radius: 5px;
}
.form-content input{
 line-height: 36px;
 padding-left:10px
}
.input-name{
 float: left;
 line-height: 36px;
}
.input-area{
 width: 50%;
 float: left;
 height: 36px;
}
.form-button{
 width: 90%;
 height: 36px;
 margin:10px auto;
 position: relative;
}
.form-button button{
 width: 50%;
 border-radius: 5px;
 min-height: 10px;
 height: 100%;
 line-height: 100%;
}
Copy after login

Effect

Detailed explanation of ionic custom pop-up box examples

The above is the detailed content of Detailed explanation of ionic custom pop-up box examples. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template