小编gen*_*ion的帖子

Twitter Bootstrap Carousel插件可以在幻灯片转换时淡入淡出

我在我正在开发的网站上有一个非常基本的Twitter Bootstrap Carousel插件实现(http://furnitureroadshow.com/).我只是想知道是否有人扩展了Carousel插件,以便它在幻灯片转换中消失并淡出?

我在github.com(https://github.com/twitter/bootstrap/issues/2050)上发现了这个问题#2050,这似乎表明在这一点上,它是不可能的.只是想看看它是否已经或已经完成.

jquery carousel twitter-bootstrap

67
推荐指数
4
解决办法
11万
查看次数

Twitter Bootstrap Carousel插件延迟页面加载

不知道插件为什么会这样表现,但每当我用carousel插件刷新页面时,包含的div是空白的5秒钟,然后旋转木马将开始正常运行 - 滑过.

我创建了一个精简版,只是为了看看是否有其他事情妨碍了事情的发展.这就是我所拥有的:

<html>
    <head>

        <link rel="stylesheet" href="bootstrap.min.css" type="text/css">
        <link rel="stylesheet" href="css/carousel.css" type="text/css">

        <script type="text/javascript" src="scripts/jquery-1.7.1.min.js"></script>

        <script type="text/javascript" src="scripts/bootstrap-transition.js"></script>
        <script type="text/javascript" src="scripts/bootstrap-carousel.js"></script>

        <script type="text/javascript">
            $(function() {
                $('#myJumbotron').carousel();
            }); 

        </script>

    </head>

    <body>

        <!-- JUMBOTRON
===================================================================== -->
        <div class="container">
            <div class="row">
                <section class="span16">

                    <div id="myJumbotron" class="carousel">
                        <div class="carousel-inner">

                            <div class="item">
                                <img src="images/jumbotron.jpg" alt="Featured specials" />
                            </div>

                            <div class="item">
                                <img src="http://placehold.it/940x380" alt="Featured specials" />
                            </div>

                            <div class="item">
                                <img src="images/jumbotron.jpg" alt="Featured specials" />
                            </div>

                        </div>
                        <a class="left carousel-control" href="#myJumbotron" data-slide="prev">&lsaquo;</a>
                        <a class="right carousel-control" …
Run Code Online (Sandbox Code Playgroud)

jquery jcarousel twitter-bootstrap

11
推荐指数
1
解决办法
6942
查看次数

在jQuery中执行.replaceWith()时,不会保留事件绑定

这是一个简洁的例子.

请记住,.chat-reply类有一个绑定到它的click事件处理程序.

HTML(回复按钮):

<div class="container">
    <a href="#" class="btn small chat-reply">Reply</a>
</div>
Run Code Online (Sandbox Code Playgroud)

当有人单击另一个向服务器发送消息以保存在数据库中的按钮时,将调用此jQuery函数.这是通过ajax完成的,并且成功完成.在前面提到的.ajax()success()回调函数中调用了这个函数:

$.ajax({
      type      :  'GET',
      url       :  '/some_controller/some_method',
      success   :  function(data) {

      $('.container').replaceWith(data);
    }
});
Run Code Online (Sandbox Code Playgroud)

上面成功回调中的"数据"将替换整个 .container div,包括child .chat-reply按钮.在此replaceWith()之后,click事件不再绑定到该按钮.

从逻辑上讲,我试图让最终用户向时间线发布消息,然后在时间线中显示该消息,无需刷新屏幕.

ajax jquery event-handling replacewith

7
推荐指数
1
解决办法
7165
查看次数

我如何使用findBy魔术查找函数WITH $ fields可选参数?

正在考虑findBy在今天使用模型上的魔术函数,并在尝试为函数设置可选参数时遇到问题.这是我试过的.

$result = $this->findById($id['Alpha.name']);
Run Code Online (Sandbox Code Playgroud)

所以要解释一下,我试图找到一个具有特定的记录,id只返回该name字段的值.根据文档,有一种方法可以做到这一点.

findBy魔术函数也接受一些可选参数: findBy<fieldName>(string $value[, mixed $fields[, mixed $order]]);

CakePHP 1.3 Book :: findBy

当我做一个简单的findBy($id)事情时,我会得到一个结果集.但是有了参数,我什么都没得到.我知道还有其他方法可以做到这一点,但只是好奇,如果有人使用这些神奇的功能与其他参数取得任何成功?

cakephp cakephp-1.3

6
推荐指数
1
解决办法
1万
查看次数