Laravel HTML链接打开Bootstrap模式并获取数据

时间:2016-02-19 11:25:22

标签: javascript twitter-bootstrap laravel

我希望有一个Laravel HTML链接,它可以在同一页面上打开一个Bootstrap模式,并从链接中的ID中获取数据。与您在Twitter上点击推文时发生的情况类似。

在那一刻,我只能在新页面上打开它。

blade.php:

{!! Html::linkAction('ContentController@getImages', 'Screenshots', array($row->ID), array('class' => 'trigger')) !!}

routes.php文件:

Route::get('screenshots/{id}', 'ContentController@getImages');

screenshots/{id}是另一个页面。我想在同一页面上打开Bootstrap模式,即content/{year}/{category}

JS:

$(document).ready(function() {
    $('.trigger').on('click', function() {
        $(window).scroll(function() {
            clearTimeout($.data(this, 'scrollTimer'));
            $.data(this, 'scrollTimer', setTimeout(function() {
                $('#myModal').modal('show');      
            }, 250));
            $(this).unbind('scroll');
        });
    });
});

我已经使用标准的HTML链接进行了测试,它打开了Bootstrap模式。

0 个答案:

没有答案