2016-02-11 32 views
0

我真的想使用jQuery步但這並不喜歡,甚至是工作或裝載,它只顯示h1和DIV塊,只有HTML被加載jQuery的步驟無所事事

這裏是代碼我從他們那裏拿走,我不知道我是否需要做別的事情。

<html> 
<head> 
    <title>Demo</title> 
    <meta charset="utf-8"> 
    <script type='text/javascript' src="jquery.js"></script> 
    <script type='text/javascript' src="jquery.steps.js"></script> 
    <script type='text/javascript' src="jquery.steps.min.js"></script> 
</head> 
<body> 
    <script> 
     $("#wizard").steps(); 
    </script> 
    <div id="wizard"> 
<h1>First Step</h1> 
<div>First Content</div> 

<h1>Second Step</h1> 
<div>Second Content</div> 
</div> 
</body> 
</html> 
+1

你已經包括'steps.js'兩次? – adeneo

+1

此外,您正在運行DOM中的元素之前的代碼 – adeneo

+0

有一兩個它不起作用,我會搜索關於DOM,但我對js很新,所以如果您能解釋我將不勝感激 –

回答

0

立即試用?

<html> 
 
<head> 
 
    <title>Demo</title> 
 
    <meta charset="utf-8"> 
 
    <script type='text/javascript' src="https://code.jquery.com/jquery-2.2.0.min.js"></script> 
 
    <script type='text/javascript' src="jquery.steps.min.js"></script> 
 
</head> 
 
<body> 
 
     <script> 
 
      $("#wizard").steps(); 
 
     </script> 
 
     <div id="wizard"> 
 
    <h1>First Step</h1> 
 
    <div>First Content</div> 
 
    
 
    <h1>Second Step</h1> 
 
    <div>Second Content</div> 
 
</div> 
 
    <script> 
 
    // Initialize wizard 
 
var wizard = $("#wizard").steps(); 
 
    
 
// Add step 
 
wizard.steps("add", { 
 
    title: "HTML code", 
 
    content: "<strong>HTML code</strong>" 
 
}); 
 
    </script> 
 
    </body> 
 
</html>

+0

它的工作,不完全像網站上的例子,我不知道如何在那裏應用樣式。我認爲它不是簡單的,因爲我打了謝謝 –

+0

我會給你添加一些款式,但請接受我的答案作爲一個正確的^ _^ – Microsmsm

+0

謝謝,它的完成...我想我已經做到了,已經大聲笑 –