這篇文章給大家分享的是有關(guān)ionic如何實(shí)現(xiàn)自定義彈框效果的內(nèi)容。小編覺(jué)得挺實(shí)用的,因此分享給大家做個(gè)參考,一起跟隨小編過(guò)來(lái)看看吧。
創(chuàng)新互聯(lián)-專(zhuān)業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性?xún)r(jià)比大興安嶺網(wǎng)站開(kāi)發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫(kù),直接使用。一站式大興安嶺網(wǎng)站制作公司更省心,省錢(qián),快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋大興安嶺地區(qū)。費(fèi)用合理售后完善,10年實(shí)體公司更值得信賴(lài)。
思路
利用ionic自帶的彈框$ionicPopup。
隱藏頭部和尾部,只保留body部分
在利用templateUrl或者template,引入需要的模板
代碼
$ionicPopup.show({ cssClass:'team-popup', template: "<div class='list popup-form'>" + "<div class = 'form-title'>{{tempItem.name}}</div>" + "<div class='form-content'>" + "<div class='input-name'>input1:</div>" + "<div class='input-area'><input type='number' placeholder='10.00' ng-model='tempItem.input1'></div>" + "</div>" + "<div class='form-content'>" + "<div class='input-name'>input2:</div>" + "<div class='input-area'><input type='number' ng-model='tempItem.input2'></div>" + "</div>" + "<div class='form-button'>" + "<button class='button wyl-left-button' ng-click='fnClosePopup()' >cancel</button>" + "<button class='button wyl-right-button' ng-click='fnExchangeGoods()' >submit</button>" + "</div>" + "</div>", scope: $scope });
/**彈出窗popup 無(wú)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%; }
效果
感謝各位的閱讀!關(guān)于“ionic如何實(shí)現(xiàn)自定義彈框效果”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,讓大家可以學(xué)到更多知識(shí),如果覺(jué)得文章不錯(cuò),可以把它分享出去讓更多的人看到吧!
本文標(biāo)題:ionic如何實(shí)現(xiàn)自定義彈框效果
文章位置:http://www.chinadenli.net/article0/gcisio.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供靜態(tài)網(wǎng)站、關(guān)鍵詞優(yōu)化、微信小程序、網(wǎng)站設(shè)計(jì)公司、標(biāo)簽優(yōu)化、自適應(yīng)網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話(huà):028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)