mazey
    Preparing search index...

    Function setImgSizeBySrc

    • Sets the width and height of all images on the page based on their src attribute. The src attribute should contain width and/or height values in the format "width=100" or "height=100". If jQuery is available, this function uses jQuery to select the images. Otherwise, it uses pure JavaScript.

      Usage:

      <img src="image.jpg?width=100px&height=200px">
      
      import { setImgSizeBySrc } from "mazey";

      setImgSizeBySrc();

      Output:

      <img src="image.jpg?width=100px&height=200px" width="100px" height="200px">
      

      Returns boolean

      • Returns true if images were found and their dimensions were set, otherwise false.