Processing
 

Jquery rotate pictures in a list

25/02/2014 13:14#1

Elham Gdz

Member

Joined at: 5 months ago

Post: 1

Thank: 0

Thanked: 0

In my page i have a list that i use Jquery's rotate method for and works correctly in Firefox but not in Chrome.

Firefox:

Jquery rotate pictures in a list

Chrome:

Jquery rotate pictures in a list

As you see in pictures in chrome box of first image is empty and it is show in second box.

HTML:

            <div class="m-main-tbl m-b-s">                 <div>                     <span class="m-main-image"><img id="big-img" src="/images/cute-baby.png"/></span>                 </div>                 <div>                     <span class="m-main-more-info">                         <p class="title m-p1"><a class="m-a1" href="#">Clothes</a></p>                         <p class="info m-p3">                             <span class="p-two-2 p-green-2">3 day</span>                             <span class="m-p3 p-two-2 p-ex">until end</span>                             <span class="m-p3 p-two-2 p-span-m">|</span>                             <span class="m-p3 p-two-2 p-green-2">450/000 $</span>                             <span class="p-two-2">Support</span>                             <span class="p-two-2 p-left"><a class="m-a2" href="#">More...</a></span>                         </p>                     </span>                 </div>                 <div>                     <span class="m-left-tbl">                         <div class="m-box-show m-first-div">                             <img class="m-div-image" src="/images/cute-baby.thm.png"/>                             <div class="m-first-div2">                                 <p class="title m-p1"><a class="m-a1" href="#">Clothes</a></p>                                 <p class="m-p2">Clothes for childrens</p>                                 <p class="info m-p3">                                     <span class="p-two-2 p-green-2">3 day</span>                                     <span class="m-p3 p-two-2 p-ex">until end</span>                                     <span class="m-p3 p-two-2 p-span-m">|</span>                                     <span class="m-p3 p-two-2 p-green-2">450/000</span>                                     <span class="p-two-2">Support</span>                                     <span class="p-two-2 p-left"><a class="m-a2" href="#">More...</a></span>                                 </p>                                 <p class="m-p-last">                                     <span class="m-p3 p-two-2">Status</span>                                     <div class="m-progress">                                         <div class="m-progress-green"></div>                                     </div>                                     <button class="m-btn-success">Support</button>                                 </p>                             </div>                         </div>                         <div class="m-box-show m-second-div m-first-div">                             <img class="m-div-image" src="/images/image.thm.png"/>                             <div class="m-first-div2">                                 <p class="title m-p1"><a class="m-a1" href="#">Magic Ring</a></p>                                 <p class="m-p2">Magic ring for you</p>                                 <p class="info m-p3">                                     <span class="p-two-2 p-green-2">3 day</span>                                     <span class="m-p3 p-two-2 p-ex">until end</span>                                     <span class="m-p3 p-two-2 p-span-m">|</span>                                     <span class="m-p3 p-two-2 p-green-2">450/000</span>                                     <span class="p-two-2">Support</span>                                     <span class="p-two-2 p-left"><a class="m-a2" href="#">More...</a></span>                                 </p>                                 <p class="m-p-last">                                     <span class="m-p3 p-two-2">Status</span>                                 <div class="m-progress">                                     <div class="m-progress-green"></div>                                 </div>                                 <button class="m-btn-success">Support</button>                                 </p>                             </div>                         </div>                         <div class="m-box-show m-second-div m-first-div">                             <img class="m-div-image" src="////images/image3.thm.png"/>                             <div class="m-first-div2">                                 <p class="title m-p1"><a class="m-a1" href="#">Glasses</a></p>                                 <p class="m-p2">Glasses for you</p>                                 <p class="info m-p3">                                     <span class="p-two-2 p-green-2">3 day</span>                                     <span class="m-p3 p-two-2 p-ex">until end</span>                                     <span class="m-p3 p-two-2 p-span-m">|</span>                                     <span class="m-p3 p-two-2 p-green-2">450/000</span>                                     <span class="p-two-2">Support</span>                                     <span class="p-two-2 p-left"><a class="m-a2" href="#">More...</a></span>                                 </p>                                 <p class="m-p-last">                                     <span class="m-p3 p-two-2">Status</span>                                 <div class="m-progress">                                     <div class="m-progress-green"></div>                                 </div>                                 <button class="m-btn-success">Support</button>                                 </p>                             </div>                         </div>                         <div class="m-box-show m-second-div m-first-div">                             <img class="m-div-image" src="////images/image3.thm.png"/>                             <div class="m-first-div2">                                 <p class="title m-p1"><a class="m-a1" href="#">Glasses</a></p>                                 <p class="m-p2">Glasses for you</p>                                 <p class="info m-p3">                                     <span class="p-two-2 p-green-2">3 day</span>                                     <span class="m-p3 p-two-2 p-ex">until end</span>                                     <span class="m-p3 p-two-2 p-span-m">|</span>                                     <span class="m-p3 p-two-2 p-green-2">450/000</span>                                     <span class="p-two-2">Support</span>                                     <span class="p-two-2 p-left"><a class="m-a2" href="#">More...</a></span>                                 </p>                                 <p class="m-p-last">                                     <span class="m-p3 p-two-2">Status</span>                                 <div class="m-progress">                                     <div class="m-progress-green"></div>                                 </div>                                 <button class="m-btn-success">Support</button>                                 </p>                             </div>                         </div>                         <div class="m-box-show m-second-div m-first-div">                             <img class="m-div-image" src="////images/image3.thm.png"/>                             <div class="m-first-div2">                                 <p class="title m-p1"><a class="m-a1" href="#">Glasses</a></p>                                 <p class="m-p2">Glasses for you</p>                                 <p class="info m-p3">                                     <span class="p-two-2 p-green-2">3 day</span>                                     <span class="m-p3 p-two-2 p-ex">until end</span>                                     <span class="m-p3 p-two-2 p-span-m">|</span>                                     <span class="m-p3 p-two-2 p-green-2">450/000</span>                                     <span class="p-two-2">Support</span>                                     <span class="p-two-2 p-left"><a class="m-a2" href="#">More...</a></span>                                 </p>                                 <p class="m-p-last">                                     <span class="m-p3 p-two-2">Status</span>                                 <div class="m-progress">                                     <div class="m-progress-green"></div>                                 </div>                                 <button class="m-btn-success">Support</button>                                 </p>                             </div>                         </div>                         <div class="m-box-show m-second-div m-first-div">                             <img class="m-div-image" src="////images/image3.thm.png"/>                             <div class="m-first-div2">                                 <p class="title m-p1"><a class="m-a1" href="#">Glasses</a></p>                                 <p class="m-p2">Glasses for you</p>                                 <p class="info m-p3">                                     <span class="p-two-2 p-green-2">3 day</span>                                     <span class="m-p3 p-two-2 p-ex">until end</span>                                     <span class="m-p3 p-two-2 p-span-m">|</span>                                     <span class="m-p3 p-two-2 p-green-2">450/000</span>                                     <span class="p-two-2">Support</span>                                     <span class="p-two-2 p-left"><a class="m-a2" href="#">More...</a></span>                                 </p>                                 <p class="m-p-last">                                     <span class="m-p3 p-two-2">Status</span>                                 <div class="m-progress">                                     <div class="m-progress-green"></div>                                 </div>                                 <button class="m-btn-success">Support</button>                                 </p>                             </div>                         </div>                     </span>                 </div>             </div> 

Jquery:

function rotatePics(){     var first = $('.m-box-show:first');     var height = first.height();      first.fadeOut('slow', function() {         first.detach();          var next = $('.m-box-show:first');         next.removeClass('m-second-div');         next.css('margin-top', height + 'px');         first.insertAfter('.m-box-show:last');         next.animate({marginTop: 0}, 1000);          first.css('margin-top', '5px');         first.addClass('m-second-div');         first.fadeIn();          var more = $('.m-main-more-info');         more.find('.title').html(next.find('.title').html());         more.find('.info').html(next.find('.info').html());          $('#big-img').attr('src', next.find('img').attr('src').replace('.thm',''));     }); } 

How can i fix it? Thank you.

Similar articles

Chrome, THREE.js: Cross-origin image load denied

5 years ago - Reply: 5 - Views: 269

Prevent Google Chrome Log XMLHttpRequest

3 years ago - Reply: 5 - Views: 276

How can I include ChromeDriver in a JAR?

3 years ago - Reply: 3 - Views: 81

Chrome geolocation not working on any site

3 years ago - Reply: 1 - Views: 46

wrong borders' width in android browser

3 years ago - Reply: 4 - Views: 206

Uncaught SyntaxError: Unexpected token < On Chrome

3 years ago - Reply: 10 - Views: 468

Flashdata not getting cleared in Codeigniter

3 years ago - Reply: 5 - Views: 57

Illegal access Javascript error in Chrome

3 years ago - Reply: 1 - Views: 51

ng-repeat not updating in Chrome

3 years ago - Reply: 1 - Views: 81

Applying border to a checkbox in Chrome

4 years ago - Reply: 2 - Views: 118

open browser plugin using access vba

3 years ago - Reply: 1 - Views: 25

vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re