Find out what the width of an image is using jQuery

前端 未结 2 836
难免孤独
难免孤独 2021-01-25 02:03

I have these images that I am getting off my server and a database using PHP

2条回答
  •  庸人自扰
    2021-01-25 02:19

    Try using .width function. something like $('img').width();

    More reading.. http://api.jquery.com/width/

    Further more, there are .innerWidth and .outerWidth functions to include/exclude padding,border and margins. See below image for details,

    enter image description here

提交回复
热议问题