Javascript 移动设备上带有大型控件的响应式Photosweep

Javascript 移动设备上带有大型控件的响应式Photosweep,javascript,jquery,photoswipe,Javascript,Jquery,Photoswipe,在这个官方代码笔中,在我的移动设备上,控件和标题看起来非常小: 我尝试将此添加到HTML中,但没有任何区别: <meta name="viewport" content="width = device-width, initial-scale = 1.0"> 如何使它们像Photosweep.com网站中的那样变大?如果您的标记看起来像Photosweep网站上建议的那样,那么您只需在figcaption元素中添加您喜欢的任何HTML元素,如下所示: <div

在这个官方代码笔中,在我的移动设备上,控件和标题看起来非常小:

我尝试将此添加到HTML中,但没有任何区别:

    <meta name="viewport" content="width = device-width, initial-scale = 1.0"> 


如何使它们像Photosweep.com网站中的那样变大?

如果您的标记看起来像Photosweep网站上建议的那样,那么您只需在
figcaption
元素中添加您喜欢的任何HTML元素,如下所示:

<div class="my-gallery" itemscope itemtype="http://schema.org/ImageGallery">
    <figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
        <a href="img/dektop/1.jpg" itemprop="contentUrl" data-size="1200x1202">
            <img src="img/thumb/1.jpg" itemprop="thumbnail" alt="Image description" />
        </a>
            <figcaption itemprop="caption img-description">
            <div class="index">
                <div class="img-title">
                    Title of the image or photo
                </div>
                <div class="img-year">
                    2003
                </div>
                <div class="dimensions">
                    1200 x 900 cm
                </div>
                <div class="technique">
                    Oil on cotton
                </div>
            </div>
            </figcaption>
    </figure>
然后,您还可以将媒体查询添加到mobile和tablet标题的样式类中(例如,如果您对默认值不满意)

@media screen and (min-width:0px) {
    .img-title {
        font-size: 2em;
    }

    .img-year {
        font-size: 1.2em;
    }

    .dimensions {
        font-size: 1em;
    }

    .technique {
        font-size: 0.8em;
    }              
}


@media screen and (min-width:320px) {
    .img-title {
        font-size: 4em;
    }

    .img-year {
        font-size: 2.2em;
    }

    .dimensions {
        font-size: 1.5em;
    }

    .technique {
        font-size: 1.1em;
    }              
}   
记住包括所有JS和CSS文件如图所示:


我也遇到了这个问题,并将其链接起来,让您了解如何使用Photosweep项目和您在问题中链接的代码笔中也使用的HTML标记构建一个响应性的图库网格

@media screen and (min-width:0px) {
    .img-title {
        font-size: 2em;
    }

    .img-year {
        font-size: 1.2em;
    }

    .dimensions {
        font-size: 1em;
    }

    .technique {
        font-size: 0.8em;
    }              
}


@media screen and (min-width:320px) {
    .img-title {
        font-size: 4em;
    }

    .img-year {
        font-size: 2.2em;
    }

    .dimensions {
        font-size: 1.5em;
    }

    .technique {
        font-size: 1.1em;
    }              
}   
<!-- Core CSS file -->
<link rel="stylesheet" href="path/to/photoswipe.css"> 

<!-- Skin CSS file (styling of UI - buttons, caption, etc.)
     In the folder of skin CSS file there are also:
     - .png and .svg icons sprite, 
     - preloader.gif (for browsers that do not support CSS animations) -->
<link rel="stylesheet" href="path/to/default-skin/default-skin.css"> 

<!-- Core JS file -->
<script src="path/to/photoswipe.min.js"></script> 

<!-- UI JS file -->
<script src="path/to/photoswipe-ui-default.min.js"></script>