2011-01-22 2 views
3

다음은 탭 페이지를 만드는 데 사용하는 HTML 코드입니다.jQuery tabs() 함수가 탭을 표시하지 않습니다.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
<html> 
<head> 
    <script type="text/javascript" src="jquery.js"></script> 
    <script type="text/javascript" src="jquery-ui-1.8.9.custom.min.js"></script> 
    <title>Testing Tabs</title> 
</head> 
<body> 
    <div id="tabs"> 
    <ul> 
     <li><a href="#panel1">Panel 1</a></li> 
     <li><a href="#panel2">Panel 2</a></li> 
     <li><a href="#panel3">Panel 3</a></li> 
    </ul> 
    <div id="panel1"> 
     <p>This is the text of panel 1</p> 
    </div> 
    <div id="panel2"> 
     <p>This is the text of panel 2</p> 
    </div> 
    <div id="panel3"> 
     <p>This is the text of panel 3</p> 
    </div> 
    </div> 
</body> 

내가 명령을 $ ('# 탭')을 실행 . 탭() (또는 $ ('# 탭'). 탭 ({})) 방화범이 끌려 명령 줄에서, 아무것도 정말 즉, 링크가 링크로 남아 있고 모든 div가 표시됩니다.

답변

4

jQueryUI 스타일 시트도 포함시켜야합니다.

<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/themes/ui-lightness/jquery-ui.css" /> 

예 :http://jsfiddle.net/6kg7k/

+0

D' 오! 매우 멍청한. – vishakad