0
私の背景をJavaScriptで表示するにはどうすればいいですか?このスクリプトはJavaScriptの中でCSSを使用しているようですが、何らかの理由で背景色を追加できますが、画像は追加できません。私はイメージを使用することができるように、これを回避する方法はありますか?ここiScrollのjavascript内で背景画像を使用しようとしています。
は、背景画像(画像/ scrollbar_bg.png)を表示するために取得しようとイムコードのセクションで
if (that.options.scrollbarClass)
bar.className = that.options.scrollbarClass + dir.toUpperCase();
else bar.style.cssText = 'position:absolute;z-index:100;
absolute; left: 0px; margin-left: 14px; background-url: images/scrollbar_bg.png; '
+ (dir == 'h' ? 'height:7px; bottom:20px; left:2px; right:
' + (that.vScrollbar ? '7' : '2') + 'px' : 'width:7px;bottom:'
+ (that.hScrollbar ? '7' : '2') +
'px;top:14px;right:1px -border-radius:3px;border-radius:3px');
おかげあなたからbackground-url
を手に入れた
ありがとうanimusonは、しかし、そのコードは、Dreamweaverで私にエラーを与えているようだと動作しません:( – Farreal
@Dan:どのようなエラー – animuson
私はちょうど私が が見るあなたの構文を使用する場合、その行の上に赤い線を得るように見えます?以下のための自分
(that.options.scrollbarClass)bar.className = that.options.scrollbarClass + dir.toUpperCase()もし、 他\t \t \t bar.style.cssText =「位置:絶対; Zインデックス:100左:0px;余白 - 左:14px;背景画像:url(images/scrollbar_bg.png); '+(dir ==' h '?' height:7px; bottom:20px; left:2px; right: '+(that.vScrollbar?' 7 ':' 2 ')+' px ':'幅:7px ;下部: '+(that.hScrollbar? '7': '2')+ 'px;上:14px;右:1px-ボーダー半径:3px;ボーダー半径:3px'); – Farreal