Simple JQuery script working on JSFiddle, not on my site

后端 未结 4 638
有刺的猬
有刺的猬 2021-01-20 03:02

I\'m trying to get the original width of an image with JQuery and make some adjustments in the CSS with a condition if an image is wider than 700px.

I used this code

4条回答
  •  清酒与你
    2021-01-20 03:20

    Use the jQuery document ready function like this:

    $(document).ready(function(){
    
    });
    

    This is a common "bug" with code that is copied from jsFiddles.

提交回复
热议问题