2017-08-01 90 views
0

我正試圖整合This打字機效果。集成css/js打字機效果,jsfiddle

我已經嘗試設置它在這裏https://jsfiddle.net/74cq52az/

,但沒有運氣,任何人都可以看看,並給我一個提示有什麼不對?

我遵循了說明中包含的步驟。

HTML

<script src="www.cognition-webdesign.dk/wp-content/themes/cognition/js/Typist-master/dist/typist.js"></script> 
<strong id="typist-element" data-typist="sut,min,dut">great</strong> 

CSS

@keyframes blink { 
0% { opacity: 1.0; } 
50% { opacity: 0.0; } 
100% { opacity: 1.0; } 
} 

@-webkit-keyframes blink { 
0% { opacity: 1.0; } 
50% { opacity: 0.0; } 
100% { opacity: 1.0; } 
} 

#typist-element { 
&:after { 
content: " "; 
display: inline-block; 
height: 47px; 
position: relative; 
top: 10px; 
margin-left: 3px; 
margin-right: 7px; 
width: 4px; 
background: #06a44d; 
animation: blink 1s step-start 0s infinite; 
-webkit-animation: blink 1s step-start 0s infinite; 
} 
} 

.selectedText { 

} 

的Javascript

(function() { 
var typist; 
typist = document.querySelector('#typist-element'); 
new Typist(typist, { 
    letterInterval: 60, 
    textInterval: 3000. 
}); 
}.call(this)); 

回答

0

你的腳本SRC失蹤https協議:

腳本標籤更改爲:

<script src="https://www.cognition-webdesign.dk/wp-content/themes/cognition/js/Typist-master/dist/typist.js"></script>

如果你看了,你會看到下面的錯誤控制檯:

Mixed Content: The page at 'https://jsfiddle.net/74cq52az' was loaded over HTTPS, but requested an insecure script 'http://www.cognition-webdesign.dk/wp-content/themes/cognition/js/Typist-master/dist/typist.js'. This request has been blocked; the content must be served over HTTPS.

+0

我明白了,那麼我希望我能夠在這個設置它解決我的實際問題封閉的環境,但它根本不幫助我。在開始時我的網站上沒有工作,它說「很棒」 – Vegapunk