Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Twitter bootstrap 3 如何在bootstrap和jssor中用col-md-8类填充div?_Twitter Bootstrap 3_Jssor - Fatal编程技术网

Twitter bootstrap 3 如何在bootstrap和jssor中用col-md-8类填充div?

Twitter bootstrap 3 如何在bootstrap和jssor中用col-md-8类填充div?,twitter-bootstrap-3,jssor,Twitter Bootstrap 3,Jssor,我希望jssor组件中的images容器使用col-md-8类填充div。我尝试删除宽度和高度,更改位置属性,不使用百分比或自动属性,大多数时候图像会消失。有没有办法做到这一点 <div class="col-md-8"> <div id="slider1_container" class="" style="position: relative; top: 0px; left: 0px; width: 650px; height: 350px;">

我希望jssor组件中的images容器使用col-md-8类填充div。我尝试删除宽度和高度,更改位置属性,不使用百分比或自动属性,大多数时候图像会消失。有没有办法做到这一点

<div class="col-md-8">
    <div id="slider1_container" class="" style="position: relative; top: 0px; left: 0px; width: 650px; height: 350px;">
        <!-- Slides Container -->
        <div data-u="slides" class="" style="cursor: move; position: relative; overflow: hidden; left: 0px; top: 0px; width: 650px; height: 350px;">
            @foreach (var image in Model.RandomAlbum.Images)
            {
                <div><img src="~/Content/uploads/original/@image.Name" data-u="image" class="img-responsive" /></div>
            }
        </div>
    </div>
</div>

@foreach(Model.RandomAlbum.Images中的var图像)
{
}

Jssor滑块是用固定大小指定的,但您可以通过调用api$ScaleWidth将其缩放到任何大小

使用以下代码,可以在父容器中安装滑块

    //responsive code begin
    //you can remove responsive code if you don't want the slider scales
    //while window resizes
    function ScaleSlider() {
        var parentWidth = $('#slider1_container').parent().width();
        if (parentWidth) {
            jssor_slider1.$ScaleWidth(parentWidth);
        }
        else
            window.setTimeout(ScaleSlider, 30);
    }
    //Scale slider after document ready
    ScaleSlider();

    //Scale slider while window load/resize/orientationchange.
    $(window).bind("load", ScaleSlider);
    $(window).bind("resize", ScaleSlider);
    $(window).bind("orientationchange", ScaleSlider);
    //responsive code end

参考资料:

您只需将滑块放入“col-md-8”即可,无需更改。他们有什么问题?是的,但不起作用,我必须指定一个高度和宽度,如果我不这样做,图像就不会显示!!!我只想用col-md-8类的图片填充div。您提供的修改代码对我来说非常好。谢谢:D