vendredi 28 décembre 2018

Making datasize change to each images dimensions

I am using photo swipe and laravel and bringing in images to the photoswipe gallery by a foreach. With photoswipe you have to define data-size and i am unsure on how i set this to define the size automatically. At the moment i have it predefined and its stretching small images and shrinking bigger images. Has anyone had any experience with this and the photoswipe plugin and managed to define it automatically foreach loaded images dimensions?

Here is the code that includes the data-size definition:

   <figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject" >

     <a href="" itemprop="contentUrl" data-size="1200x600">
     <img src="" itemprop="thumbnail" alt="Userimage"  />
     </a>

    <figcaption itemprop="caption description">Uploaded by: , </figcaption>


   </figure>



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire