css要素を加える .css(property, value); css要素を取得 .css(property)
.css(property, value);
.css(property)
function s1Func01(){ $(this).css({ background:"red", color:"black", transform: "scale(1.2)", transform: "rotate(-45deg)" }); } function s1Func02(){ $(this).css({ background: "black", color: "yellow", filter: "blur(2px)", transition: "0.5s" }); }
$(function(){ $("#sample3 div").click(function () { var color = $(this).css("background-color"); $("#result").html("背景色: " + color + "."); }); });
$(function(){ $("#s4Btn").click(function(){ $("#s4Field").css({ "background-image": "url('../../img/reims.jpg')", "background-attachment": "fixed", "background-size": "cover" }); }); });