简体   繁体   English

jQuery Photo Wall Gallery插件

[英]jQuery photo wall gallery plugin

I didn't understand how can I use this plugin if I want show images which are in my computer https://github.com/creotiv/jquery-photowall/blob/master/README.rst 如果我要显示计算机中的图像,我不明白如何使用此插件https://github.com/creotiv/jquery-photowall/blob/master/README.rst

<!DOCTYPE html>

<html>

<head>
    <script type="text/javascript" src="jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="jquery-photowall.js"></script>
    <link rel="stylesheet" type="text/css" href="jquery-photowall.css">
</head>

<body>

    <script type="text/javascript">
    $(document).ready(function(){
        PhotoWall.init({
            el:             '#gallery'               // Gallery element
            ,zoom:          true                     // Use zoom
            ,zoomAction:    'mouseenter'             // Zoom on action
            ,zoomTimeout:   500                      // Timeout before zoom
            ,zoomDuration:  100                      // Zoom duration time
            ,showBox:       true                     // Enavle fullscreen mode
            ,showBoxSocial: true                     // Show social buttons
            ,padding:       10                       // padding between images in gallery
            ,lineMaxHeight: 150                      // Max set height of pictures line
                                                     // (may be little bigger due to resize to fit line)
        });

        /*

            Photo object consist of:

            {   // big image src,width,height and also image id
                id:
                ,img:       //src
                ,width:
                ,height:
                ,th:{
                    src:      //normal thumbnail src
                    zoom_src: //zoomed normal thumbnail src
                    zoom_factor: // factor of image zoom
                    ,width:   //width of normal thumbnail
                    ,height:  //height of normal thumbnail
                }
            };

        */

        var PhotosArray = new Array(
            {id:id,img:'my_img1.jpg',width:500,height:400,
             th:{src:'my_img1.jpg',width:50,height:40,
                 zoom_src:'my_img1.jpg',zoom_factor:4
                }
            },
            {id:id,img:'my_img2.jpg',width:500,height:400,
             th:{src:'my_img2.jpg',width:50,height:40,
                 zoom_src:'my_img2.jpg',zoom_factor:4
                }
            },
            {id:id,img:'my_img3.jpg',width:500,height:400,
             th:{src:'my_img3.jpg',width:50,height:40,
                 zoom_src:'my_img3.jpg',zoom_factor:4
                }
            },
            {id:id,img:'my_img4.jpg',width:500,height:400,
             th:{src:'my_img4.jpg',width:50,height:40,
                 zoom_src:'my_img4.jpg',zoom_factor:4
                }
            }
        );

        PhotoWall.load(PhotosArray);
        });

    </script>

    <div id="gallery">
        <div class="body"></div>
    </div>

</body>

</html>

But I can't see anything How can I solve that problem? 但是我什么也看不到,我该如何解决这个问题?

Create folder img and move all your img to that folder and add path as following code. 创建文件夹img并将所有img移至该文件夹,并按以下代码添加路径。 make sure images names are correct 确保图像名称正确

<!DOCTYPE html>

<html>

<head>
    <script type="text/javascript" src="jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="jquery-photowall.js"></script>
    <link rel="stylesheet" type="text/css" href="jquery-photowall.css">
</head>

<body>

    <script type="text/javascript">
    $(document).ready(function(){
        PhotoWall.init({
            el:             '#gallery'               // Gallery element
            ,zoom:          true                     // Use zoom
            ,zoomAction:    'mouseenter'             // Zoom on action
            ,zoomTimeout:   500                      // Timeout before zoom
            ,zoomDuration:  100                      // Zoom duration time
            ,showBox:       true                     // Enavle fullscreen mode
            ,showBoxSocial: true                     // Show social buttons
            ,padding:       10                       // padding between images in gallery
            ,lineMaxHeight: 150                      // Max set height of pictures line
                                                     // (may be little bigger due to resize to fit line)
        });

        /*

            Photo object consist of:

            {   // big image src,width,height and also image id
                id:
                ,img:       //src
                ,width:
                ,height:
                ,th:{
                    src:      //normal thumbnail src
                    zoom_src: //zoomed normal thumbnail src
                    zoom_factor: // factor of image zoom
                    ,width:   //width of normal thumbnail
                    ,height:  //height of normal thumbnail
                }
            };

        */

        var PhotosArray = new Array(
            {id:id,img:'img/my_img1.jpg',width:500,height:400,
             th:{src:'img/my_img1.jpg',width:50,height:40,
                 zoom_src:'img/my_img1.jpg',zoom_factor:4
                }
            },
            {id:id,img:'img/my_img2.jpg',width:500,height:400,
             th:{src:'img/my_img2.jpg',width:50,height:40,
                 zoom_src:'img/my_img2.jpg',zoom_factor:4
                }
            },
            {id:id,img:'img/my_img3.jpg',width:500,height:400,
             th:{src:'img/my_img3.jpg',width:50,height:40,
                 zoom_src:'img/my_img3.jpg',zoom_factor:4
                }
            },
            {id:id,img:'my_img4.jpg',width:500,height:400,
             th:{src:'my_img4.jpg',width:50,height:40,
                 zoom_src:'my_img4.jpg',zoom_factor:4
                }
            }
        );

        PhotoWall.load(PhotosArray);
        });

    </script>

    <div id="gallery">
        <div class="body"></div>
    </div>

</body>

</html>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM