响应式幻灯片 如何使图像的宽度占据整个页面

ResponsiveSlides How do I make the width of the images occupy entire page?

本文关键字:幻灯片 何使 图像 响应      更新时间:2023-09-26

我想让图像的宽度占据整个页面,就像这样:

http://i1240.photobucket.com/albums/gg491/Nerio_Navea/Screenshots/GoogleChrome2014-12-30220149_zps99e94bc2.png

但我找不到这个属性。

我是使用Jquery的新手,但我了解Javascript

请有人帮我解决这个问题

我是StackOverflow的新手

对不起我的英语;D

我不知道你到底想要什么,但你可以将图像插入div,或者使用float,以便你的图像可以从正常的边距出来。

以下是您可以尝试的(使用内联 CSS):

<image src = " " style = "position: absolute; left:10; top: 100;">

只需通过在各自的位置编写左侧和顶部坐标来指定要放置图像的确切位置。这是我在阅读您的问题后得到的。

而且,通过这种方式,您可以使您的图像甚至占据整个页面。

如果您正在尝试制作响应式幻灯片,这可能会有所帮助。这是一个使用 Javascript/HTML 在滑块中包含幻灯片的示例。

  1. Javascript Code

<!-- it works the same with all jquery version from 1.x to 2.x -->
<script src="jquery.min.js"></script>
<script src="jssor.slider.mini.js"></script>
<script>
    jQuery(document).ready(function ($) {
        //Define an array of slideshow transition code
        var _SlideshowTransitions = [
        { code1 },
        { code2 },
        { code3 }
        ];
        var options = {
            $AutoPlay: true,
            $SlideshowOptions: {
                    $Class: $JssorSlideshowRunner$,
                    $Transitions: _SlideshowTransitions,
                    $TransitionsOrder: 1,
                    $ShowLink: true
                }
        };
        var jssor_slider1 = new $JssorSlider$('slider1_container', options);
    });
</script>

  1. 网页代码

<div id="slider1_container" style="position: relative; top: 0px; left: 0px; width: 600px; height: 300px;">
    <!-- Slides Container -->
    <div u="slides" style="cursor: move; position: absolute; overflow: hidden; left: 0px; top: 0px; width: 600px; height: 300px;">
        <div><img u="image" src="image1.jpg" /></div>
        <div><img u="image" src="image2.jpg" /></div>
    </div>
</div>