0
div
{
border-image:url(border.png) 30 30 round;
-moz-border-image:url(border.png) 30 30 round; /* Firefox */
-webkit-border-image:url(border.png) 30 30 round; /* Safari and Chrome */
-o-border-image:url(border.png) 30 30 round; /* Opera */
}

javascriptdomを使用してdivタグの境界線画像を変更したい

前もって感謝します

4

2 に答える 2

1
$('div').css({
  "border-image"           :  "url(border.png) 30 30 round",
  "-moz-border-image"      :  "url(border.png) 30 30 round",
  "-webkit-border-image"   :  "url(border.png) 30 30 round",
  "-o-border-image"        :  "url(border.png) 30 30 round"
});
于 2012-05-28T07:45:27.277 に答える
0

javascript domを使ってdivタグのボーダー画像を変更したい

あなたは次のようにすることができます:

var dv = document.getElementById('#divID');
dv.style.borderImage = 'url(border.png) 30 30 round';
dv.style.MozBorderImage = 'url(border.png) 30 30 round';
dv.style.WebkitBorderImage = 'url(border.png) 30 30 round';
dv.style.OBorderImage = 'url(border.png) 30 30 round';

すべての DIV に対して実行する場合:

var dvs = document.getElementsByTagName('div');

for (var i = 0; i < dvs.length; i++) {
    dvs[i].style.borderImage = 'url(border.png) 30 30 round';
    dvs[i].style.MozBorderImage = 'url(border.png) 30 30 round';
    dvs[i].style.WebkitBorderImage = 'url(border.png) 30 30 round';
    dvs[i].style.OBorderImage = 'url(border.png) 30 30 round';
}
于 2012-05-28T07:46:06.460 に答える