我正在尝试使用bootstrap Carousel延迟加载.看起来这应该是直截了当的,但我在这里甚至没有任何错误来排除故障.JS:
<script type="text/javascript">
$('#bigCarousel').on("slid", function() {
// load the next image after the current one slid
var $nextImage = $('.active.item', this).next('.item').find('img');
$nextImage.attr('src', $nextImage.data('lazy-load-src'));
});
</script>
Run Code Online (Sandbox Code Playgroud)
然后是html:
<div id="bigCarousel" class="carousel slide">
<div class="carousel-inner">
<div class="active item">
<img src="assets/bigimage1.jpg" class="img-big">
</div>
<div class="item">
<img data-lazy-load-src="assets/menu-header2.jpg" class="img-big">
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
在firebug中没有JS错误或其他任何我能弄明白的错误,但我的图像只是没有加载.这可能是一件非常简单的事......
我觉得这应该是一个简单的问题,但我正在试着追踪它.我已经安装了chargify_api_ares gem,但是甚至不能做基本的事情
Chargify::Subscription.create
Run Code Online (Sandbox Code Playgroud)
因为我得到这个路径错误.我觉得这肯定是一个宝石问题,但不知道从哪里开始.
更新:bundle show chargify_api_ares显示正确的路径,我只是以某种方式无法访问它.还在尝试随机环境相关的事情.
看起来这是问题的根源,在active_resource\base.rb中:
# Gets the \prefix for a resource's nested URL (e.g., <tt>prefix/collectionname/1.json</tt>)
# This method is regenerated at runtime based on what the \prefix is set to.
def prefix(options={})
default = site.path
default << '/' unless default[-1..-1] == '/'
# generate the actual method based on the current site path
self.prefix = default
prefix(options)
end
Run Code Online (Sandbox Code Playgroud)
据我了解,Chargify.subdomain应该设置site.path,但我还不了解activeresource还不知道发生了什么,并将继续挖掘.