Assigned width in percentage but want to get it in pixels

前端 未结 11 1147
北荒
北荒 2020-12-15 15:07



        
11条回答
  •  感情败类
    2020-12-15 15:36

    I think that should work, but if for some reason it keeps on giving you the % width, What you can do is get the width and then divide it by the window width

    var widthInPx = $(widnow).width()/$('yourElement').width
    

提交回复
热议问题