开发者

JQuery next() issues

开发者 https://www.devze.com 2023-01-26 02:50 出处:网络
I am trying simplify this images rotator function using the next() and end() but I can\'t figure it out. The goal is to iterate over images, set the title and move to the next image.

I am trying simplify this images rotator function using the next() and end() but I can't figure it out. The goal is to iterate over images, set the title and move to the next image. How can I make this work?

here is my basic html code

<div class="object">
 <div class="stories">

<div class="story" title="Microsoft Expression Encoder"
  <img src="http://example.com/sample.png" title="" alt=""/>
</div>


<div class="story" title="Microsoft Expression Encoder Repeat" >
  <img src="http://example.com/sample.png" title="" alt=""/>
</div>

 </div> 
 <div class="titlebar"> 
   <div class="info"></div> 
   <div id="btn_next" class="btn_next"></div>
   <div id="btn_prev" class="btn_prev"></div>
 </div>
</div>

here 开发者_运维百科is the JavaScript code

var rotateImages = function () {

               $('.stories div:gt(0)').hide();

               $(".info").text($(".story").attr("title"));

               $(".stories div:eq(0)")

               .animate({ options}, 250,function () {
                   $(".jqb_info").text($(this).attr(title)).animate({ options }, 500);)

               .next('div')animate ({options}, 250, function () {
                   $(".jqb_info").text($(this).attr(title)).animate({ options }, 500);)

               .end().appendTo('.stories');
}


You may be getting an error having those semicolons inside your .text functions.

0

精彩评论

暂无评论...
验证码 换一张
取 消