开发者

jQuery tabs() function not displaying tabs

开发者 https://www.devze.com 2023-02-06 09:09 出处:网络
The following is my HTML code for creating a tabbed page. <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">

The following is my HTML code for creating a tabbed page.

<!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>
    &l开发者_开发技巧t;/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>

When I execute the command $('#tabs').tabs() (or $('#tabs').tabs({})) at the Firebug CommandLine, nothing really happens i.e. the links remain links, and all the divs are displayed.


Make sure you include the jQueryUI stylesheet as well.

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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号