Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/288.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
Php 如何根据分辨率在网页中订购一组图像_Php_Jquery_Ajax_Image_Resolution - Fatal编程技术网

Php 如何根据分辨率在网页中订购一组图像

Php 如何根据分辨率在网页中订购一组图像,php,jquery,ajax,image,resolution,Php,Jquery,Ajax,Image,Resolution,以下代码将在我的网页中显示myarray[]中包含的一组图像。 通过检查要放置的div的宽度和高度,根据访客的分辨率,div将分页以容纳图像(如果需要) 这些图像具有相同的尺寸115x120像素,从左到右放置。 在这之前一切都很好,但图像处理相当枯燥,我想把它们放在这张图上显示的方式: 我该怎么做?有什么线索吗 非常感谢 <script type="text/javascript"> jQuery(document).ready(function(){ setTimeout

以下代码将在我的网页中显示myarray[]中包含的一组图像。 通过检查要放置的div的宽度和高度,根据访客的分辨率,div将分页以容纳图像(如果需要)

这些图像具有相同的尺寸115x120像素,从左到右放置。 在这之前一切都很好,但图像处理相当枯燥,我想把它们放在这张图上显示的方式:

我该怎么做?有什么线索吗

非常感谢

<script type="text/javascript">
jQuery(document).ready(function(){
    setTimeout ( "execMainFunction()", 1000 );
});

function execMainFunction(){

    var myarray = new Array(26)

myarray[0]='images/1.png';
myarray[1]='images/2.png';
myarray[2]='images/3.png';
myarray[3]='images/4.png';
myarray[4]='images/5.png';
myarray[5]='images/6.png';
.
.
myarray[25]='images/26.png';


var nofImages = myarray.length; 


    var docheight = jQuery('#content').height();   
    var docwidth = jQuery('#content').width();

    var he = Math.floor((docheight/120)); // images height
    var wi = Math.floor((docwidth/115)); // images width
    var total = (he*wi);

var imagesPerDiv = total;

        var theContent = "";
        theContent +="<ul id='slide'>";
        for (var i=0;i<nofImages;i++) {

            theContent +="<li class='item'><img src='"+myarray[i]+"'></li>";

        } 

        theContent +="</div><br><div style='display:block;'></div>";
        $("#slidesContainer").html(theContent);

// the following pluging paginates the images if they number is too big for the page's resolution 
    $(function(){
       $("#slide li").quickpaginate({ perpage: imagesPerDiv, pager : $("#slidesContainer") });
    });


}
</script>

为指定数量的图像提供布局并不能告诉我们,如果图像较多或较少,布局应该是什么样子。是否要从PHP或JQuery修复布局?感谢您回答yi_H,没关系,两种语言都可以。布局应为3条图像水平线,中间的一条图像应比其他两条图像多出两条图像。再次感谢