如何在结束时更新Maximage或开始图像循环

时间:2017-12-20 13:21:31

标签: javascript jquery html css maximage2

我正在使用jquery Maximage插件来创建全屏幻灯片,使用php,json和mysql动态加载图像。 问题是如果我在数据库中上传一个或多个新图像,Maximage不会自动更新新图像。 知道如何在最后更新Maximage或开始图像循环吗?

<!DOCTYPE html>
<html class='no-js' lang='en'>
<!--<![endif]-->
<head>
    <meta charset='utf-8' />        
    <title>Kiosco</title>
    <link rel="stylesheet" type="text/css" href="lib/css/jquery.maximage.css">
    <link rel="stylesheet" type="text/css" href="lib/css/screen.css">
    <style type="text/css" media="screen">          
        #maximage {
        /* position:fixed !important; */
        }
    </style>
</head>
<body>
    <div id="maximage">
        <?php
            include "conexion/conexion.php";
            // Consult the database
            $result = mysqli_query($con,"SELECT name FROM files ORDER BY position ASC");
            //Load images
            while($row = mysqli_fetch_array($result)) {
        ?>
                    <img src="/KioskoImage/lib/images/ImagesDisplay/<?php echo $row['name'];?>" alt="" width="1400" height="1050">
        <?php 
            }
            //Close BD
            mysqli_close($con);
        ?>
    </div>
    <script src="lib/js/jquery.js"></script>
    <script src="lib/js/jquery.cycle.all.js" type="text/javascript"></script>
    <script src="lib/js/jquery.maximage.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function(){
            // Trigger maximage
            jQuery('#maximage').maximage();
        });
    </script>     
    <script type="text/javascript">
        $('#maximage').maximage({
            onImagesLoaded:      function() { 
                location.reload();
            }
        });
    </script>
</body>
</html>

0 个答案:

没有答案