javascript - Ruby on Rails: Refile Gem and Owl Carousel jQuery plugin, bad combination? Issues with image size on page load -


i got these 2 working, having trouble execution. i'm assuming 1 of them loading faster other...

<div class="owl-carousel">   <% @project.project_images.each |image| %>     <div class="bi-item">       <%= attachment_image_tag(image, :file, :fit, 1000, 430) %>     </div>   <% end %> </div> 

so got loop within owl-carousel tag... , when page loads, images tiny (see first attached image)... if drag browser size, images starts becoming responsive, , size starts changing. images correct size... i'm not sure issue be, or need working together. assumption correct? if so, how make load together?

my coffeescript

$(document).on 'ready page:load', ->   $(".owl-carousel").owlcarousel     loop: true     autowidth: true     lazyload : true 

here's screenshot, can see left side, tiny

enter image description here

then when dragged browser little smaller, image resizes, gets bigger

enter image description here

then resized browser larger, becomes normal.

enter image description here

alright, think got it...

i put owl carousel function under window.load... solved issue now. if else has solution, or better, i'd know still!

$(window).load ->    $(".owl-carousel").owlcarousel     loop: true     autowidth: true     lazyload : true 

thanks


Comments