在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML5  HTML/ css in js的一些疑問

css in js的一些疑問

1.通過設置顏色 讓其網(wǎng)站上顯示不同的背景色【就是一個賬號設置了一些樣式 使其在另一個地方展示所設置的內(nèi)容】 問題就是這樣樣式如何設置 讓其在修改的時候簡單一些
2.我在網(wǎng)上看了下css in js是一個不錯的方法 但是我看都是基于框架的例如react 我的網(wǎng)站層內(nèi)容需要兼容到較低的版本

回答
編輯回答
壞脾滊

using dynamic sub class in the html and js code, give you an example in angular.js:

in html:

<div ng-class = getDivClass(userSetting)></div>

in Controller:


$scope.getDivClass = function(userSetting){
     if(userSetting){
        return "blue";
     }
}

in css :

.blue{
   background-color: blue;
}

The above method is implemented by angular.js. if you want to use jquery or something else, the mechanism is similar.

2017年5月2日 03:10