0
複数の画像を背景として持つdivがあります。div内の特定の背景画像をjqueryで変更します。
background-image:
url(/Content/frontend/images/left.png),
url(/Content/frontend/images/right.png),
url(http://IMAGE_I_WANT_TO_TARGET),
linear-gradient($dark 0%, $light 100%);
私は私のdiv要素をターゲットと背景画像を変更した場合、それは他のすべての画像を上書きします。
$(".div").css("background-image", "url(http://placehold.it/300?text=asdasd)");
はそれだけで3番目の画像を対象とし、それを変更することは可能ですか?
いいえ – Satpal
いいえ - 更新された値でプロパティ全体を再度指定する必要があります。 –
関連するhttp://stackoverflow.com/questions/16624199/change-multiple-background-images-with-jquery – JuniorDev