2011-02-09 16 views
1

jQuery初心者!jQuery.cycle変更div背景イメージ

Cycleプラグインを使用して、スライドを循環するのではなく、divの背景イメージを変更するのに本当に問題があります。私のdivには、私が変更したくない他のコンテンツがあります。

私はこれを達成するために使用しなければならない別のプラグインがありますか?これについて最も感謝しています。

+0

私たちにいくつかのコードを教えてください。 – Thew

+0

だから私は間違った質問をしたかもしれない。サイクルを使用してdivの背景イメージを変更できますか?私は、slideExpr: 'div.mainimage'を使っていくつかのdivを使ってサイクリングしていますが、これは異なる背景と同じ内容の複数のmainimage divが必要であることを意味します。 – Rob

答えて

1

http://jsfiddle.net/petarsubotic/299Wr/

CSS

#wrapper { 
position: absolute; 
overflow:hidden; 
height: 333px; /* optional */ 
background: black; /* optional */ 
} 
#content { 
position:relative; 
z-index:999; 
float:left; 
background: rgba(0, 0, 0, 0.8); /* optional */ 
padding:1em; /* optional */ 
margin: 1em; /* optional */ 
color:white; /* optional */ 
} 
#bg_containers { 
position:absolute; 
} 

HTML

<div id="wrapper"> 
<div id="content"> 
The background image behind this can be any size, so although it may not cover your entire screen in this case, you can make it cover as much or as little of the screen as you like. Just adjust the size of the #bg_containers, and of course, you can also have the background tile if you like as well. 
</div> 
<div id="bg_containers" > 
<div><img src="http://www.australia.com/contentimages/about-landscapes-nature.jpg"/> </div> 
<div><img src="http://www.mtsu.edu/urban/images/urban1.jpg"/></div> 
</div> 
</div> 
関連する問題