亚洲一二区制服无码中字,国产无套露脸在线观看,中文字幕丝袜人妻制服丝袜在线,国内精品自线在拍2020不卡,香蕉影院在线观看

重慶網(wǎng)站建設(shè)公司,安菲科技LOGO

您的位置:首頁 > 新聞

codepen怎么保存,如何從Codepen獲取代碼
新聞 2023-03-17編輯:重慶網(wǎng)站建設(shè)標(biāo)簽: 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)建一個播放,但是當(dā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> 

我有復(fù)制,粘貼和保存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是正確的,但我認為最好導(dǎo)出您的筆(使用導(dǎo)出導(dǎo)出.zip選項在本地使用筆)。這將給你一個工作版本的筆,而不必復(fù)制和粘貼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.


相似內(nèi)容
企業(yè)網(wǎng)站定制

企業(yè)網(wǎng)站定制 根據(jù)企業(yè)需求,量身定制設(shè)計

企業(yè)網(wǎng)站定制:2800元起
添加微信 請說明來意
聯(lián)系我們
站內(nèi)搜索

24小時服務(wù)熱線 18696588163
創(chuàng)意化數(shù)字品牌整合網(wǎng)絡(luò)營銷
營銷網(wǎng)站讓你坐等商機坐傭客戶,Rss

版權(quán)所有:重慶安菲科技有限公司

友情鏈接: