jQuery.cycle изменить фоновое изображение div - PullRequest
1 голос
/ 09 февраля 2011

JQuery новичок!

У меня реальная проблема с тем, чтобы заставить плагин Cycle изменять фоновое изображение div, а не циклически перемещаться по слайдам. У моего div есть другой контент, который я не хочу менять.

Есть ли другой плагин, который я должен использовать для достижения этой цели? Помощь, наиболее ценимая в этом.

Ответы [ 2 ]

1 голос
/ 29 июля 2013

Упрощенный метод, рекомендованный Маршаллом: 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>
1 голос
/ 13 августа 2011

Эта страница должна вам помочь:

http://www.magneticwebworks.com/jquery-rotating-page-background/

...