0

標準のCSSカラー名を再定義するjavascript/jQuery関数はありますか? (単純にコピーしてプロジェクトに貼り付けることができるもの。)

例:

<div id="example"></div>

<style>

#example { background: red; }

</style>

<script>

if(true) {
    function redefineColor () {
    var backgroundColor = $("*").css("background");   //select all elements

    if( backgroundColor == "#FF0000" ) {              //red color.
      $(this).css("background","#DC143C");              //other shade of red.
    } else { return false}
    redefineColor();
}
</script>

挨拶

4

0 に答える 0