小编Rub*_*oob的帖子

Bootstrap Carousel Lazy Load

我正在尝试使用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错误或其他任何我能弄明白的错误,但我的图像只是没有加载.这可能是一件非常简单的事......

twitter-bootstrap twitter-bootstrap-2

11
推荐指数
3
解决办法
2万
查看次数

nil的未定义方法'path':使用chargify_api_ares gem的NilClass

我觉得这应该是一个简单的问题,但我正在试着追踪它.我已经安装了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还不知道发生了什么,并将继续挖掘.

chargify ruby-on-rails-3

5
推荐指数
1
解决办法
1321
查看次数