开发者

Preloading images with Paperclip (in Rails)

开发者 https://www.devze.com 2023-01-28 17:58 出处:网络
I\'m not sure how to access the src of a Paperclip img. What am I doing wrong? preloadImg = new Image;

I'm not sure how to access the src of a Paperclip img. What am I doing wrong?

preloadImg = new Image;
preloadImg = <%= @other_images[4].im开发者_如何学编程age.url[:display] %>;


You need to set preloadImg.src (and maybe wrap some quotes around the string, I don't know how Ruby handles this).

0

精彩评论

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