Topic: JQuery rotate image banner if more div tags


I am using image banner for rotation using jQuery .
This is working when used for only images but failes when included more HTML div tag in it .

working code :
function slideSwitch() {
    var $active = jQuery('#slideshow');

    if ( $active.length == 0 ) $active = jQuery('#slideshow DIV:last');

    // use this to pull the divs in the order they appear in the markup
    var $next =  $ ? $
        : jQuery('#slideshow DIV:first');


    $next.css({opacity: 0.0})
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');

<div id="slideshow">
<div class="active">

Actual code is like this :
<div id="slideshow">
<div class="active">
                      <div class="top_banner">
                        <div class="banner_left_text" style="font-family:'Trebuchet MS',Arial;">
                          <div class="banner_toptext"> Welcome </div>
                        <div class="banner_right_image"> <%= image_tag("ban1.jpg",:width=>"388",:height=>"301",:alt=>"banne1")%></div>
<div>.....2nd image </div>
<div>.....3rd image </div>

How to rotate banner if it contains more html div tags ?
Can any one help me with modified JQuery code on this .

thanks in advance.

Last edited by srinathbtech (2010-11-11 14:55:36)