簡體   English   中英

AngularJS更改css屬性值

[英]AngularJS change css property value

以下是我的html代碼段:

<div class="pay row-0 col-1 ">
        <div class="t-middle f26 f-white row-0 " style="position:absolute;top:50%;">please wait...</div>
</div>

.pay類的樣式表如下:

.pay, .stopIE {
    position: fixed;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100;
    top: 0;
    display: none;
}

單擊按鈕后,將執行以下功能。

$scope.goBuy = function(){
    Account.buyNow({"pid": $scope.buypp.id})
        .then(function(response){
            [change the .pay class display to block]
            $window.location.href = response.data;
        })

        .catch(function(response){

        })
}

在等待響應時,如何將.pay類的display屬性值從none更改為block 謝謝!!

對於具有適當范圍變量的事情,我將只使用ngShow / Hide。 為了獲得更多控制(如果需要),還可以使用ngStylengClass (最好)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM