How do I take code from Codepen, and use it locally?

后端 未结 5 1205
醉梦人生
醉梦人生 2021-02-01 21:03

How do I take the code from codepen, and use it locally in my text-editor?

http://codepen.io/mfields/pen/BhILt

I am trying to have a play with this creation loca

5条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-01 21:37

    looks like you are calling the JS before the DOM is loaded.

    try wrapping it in a

    $(function() {
        // your code here
    });
    

    which is the same as

    $(document).ready(function() {
        // your code here
    });
    

    if you are using jQuery.

    or you could include the

提交回复
热议问题