codepen怎么保存,如何從Codepen獲取代碼
codepen怎么保存,如何從Codepen獲取代碼,如何從codepen中獲取代碼,并在我的文本編輯器中編輯保存?
codepen怎么保存,如何從Codepen獲取代碼,如何從codepen中獲取代碼,并在我的文本編輯器中編輯保存?
如何從codepen中獲取代碼,并在我的文本編輯器中編輯保存?
How do I take the code from codepen, and use it locally in my text-editor?
http://codepen.io/mfields/pen/BhILt
我想在本地創(chuàng)建一個播放,但是當我用chrome打開它時,我得到一個空白的白頁,沒有任何東西。
I am trying to have a play with this creation locally, but when I open it in chrome, I get a blank white page with nothing going on.
<!DOCTYPE HTML>
<html>
<head>
<script> src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script type="text/javascript" src="celtic.js"></script>
<link rel="stylesheet" type="text/css" src="celtic.css"></link>
</head>
<body>
<canvas id="animation" width="400" height="400"></canvas>
</body>
</html>
我有復制,粘貼和保存css和js到不同的文件并保存,然后嘗試將它們鏈接到html文件,如上所示。
I have copy, pasted and saved the css and js into different files and saved them, then tried to link them into the html file as I have shown above.
我還包括jquery庫,因為我理解很多codepen創(chuàng)作使用它。
I have also included the jquery library as I understand a lot of the codepen creations use it.
我得到的唯一的控制臺錯誤是
The only console error I'm getting is
Uncaught TypeError: Cannot read property 'getContext' of null
鏈接到我的js文件第4行
which is linking to my js file, line 4
(function(){
var canvas = document.getElementById( 'animation' ),
c = canvas.getContext( '2d' ),
對不起,如果這是愚蠢的, 。我相信這是基本的,任何幫助將是真棒!
Sorry if this is dumb, but I'm new to all this. I'm sure this is basic as hell. Any help would be awesome!
Joe Fitter是正確的,但我認為最好導出您的筆(使用導出導出.zip選項在本地使用筆)。這將給你一個工作版本的筆,而不必復制和粘貼CSS,JavaScript和HTML代碼,而不必對其進行更改,使其工作。
Joe Fitter is right, but I think is better to export your pen (use the export to export.zip option for using your pen locally). This will give you a working version of your pen without having to copy and paste the CSS, JavaScript and HTML code and without having to make changes on it for making it work.
版權所有:深圳市網(wǎng)商在線科技有限公司
友情鏈接: