Skip to content
Browse files

new demo showing the use of the new showAccessibleTabSelector() method

  • Loading branch information...
1 parent 4560b0a commit 14fe659d22972b6715c8d85fb6030985cd290171 Dirk Ginader committed Apr 11, 2011
Showing with 126 additions and 0 deletions.
  1. +126 −0 open-tab-from-link-2.html
View
126 open-tab-from-link-2.html
@@ -0,0 +1,126 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <title>Opening a Tab from a link in the page (via selector) - Accessible Tabs Example</title>
+ <meta name="author" content="Dirk Ginader">
+ <script type="text/javascript">document.documentElement.className += " js";</script>
+ <link rel="stylesheet" href="slidingdoors/simple-sliding-doors.css" type="text/css" media="screen">
+ <style type="text/css" media="screen">
+ .js .tabs {
+ float: left;
+ }
+ </style>
+ <script src="js/jquery-1.4.2.js" type="text/javascript" charset="utf-8"></script>
+ <script src="js/jquery.tabs.js" type="text/javascript" charset="utf-8"></script>
+ <script src="js/jquery.syncheight.js" type="text/javascript" charset="utf-8"></script>
+
+ <script type="text/javascript">
+
+ $(document).ready(function(){
+ var tabs = $("#tabs1").accessibleTabs({
+ tabhead:'h2',
+ fx:"fadeIn",
+ syncheights:true
+ });
+ var tabs2 = $("#tabs2").accessibleTabs({
+ tabhead:'h2',
+ fx:"fadeIn",
+ syncheights:true
+ });
+ $("a[href=#dummy-text]").click(function(e){
+ e.preventDefault();
+ tabs.showAccessibleTabSelector('#dummy-text');
+ });
+ $("a[href=#anything-else]").click(function(e){
+ e.preventDefault();
+ tabs.showAccessibleTabSelector('#anything-else');
+ });
+ $("a[href=#dummy-text2]").click(function(e){
+ e.preventDefault();
+ tabs2.showAccessibleTabSelector('#dummy-text2');
+ });
+ $("a[href=#anything-else2]").click(function(e){
+ e.preventDefault();
+ tabs2.showAccessibleTabSelector('#anything-else2');
+ });
+ });
+
+ </script>
+</head>
+<body>
+ <h1>Opening a Tab from a link in the page (via selector) - Accessible Tabs Example</h1>
+ <div id="tabs1" class="tabs">
+ <h2>some dummy text</h2>
+ <div class="tabbody">
+ <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam malesuada suscipit pede. Nullam ipsum lacus, varius vel, nonummy in, consequat ut, neque. </p>
+ <h3>Lorem ipsum</h3>
+ <ul>
+ <li><a href="#dummy-text">click here to show tab number 2</a></li>
+ <li><a href="#anything-else2">click here to show tab number 3 in the other tab widget</a></li>
+ </ul>
+ <p>Nullam malesuada suscipit pede. Nullam ipsum lacus, varius vel, nonummy in, consequat ut, neque. Vivamus viverra. Duis dolor arcu, lacinia sit amet, sollicitudin sed, aliquet vel, quam. Pellentesque molestie laoreet tortor. Aenean quam. Pellentesque magna metus, venenatis sit amet, congue nec, dictum in, est. Aliquam nibh. </p>
+ </div>
+ <h2 id="dummy-text">some more dummy text</h2>
+ <div class="tabbody">
+ <p>Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. </p>
+ <p>Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque</p>
+ </div>
+ <h2 id="anything-else">anything else</h2>
+ <div class="tabbody">
+ <p>Here could be your content</p>
+ </div>
+ </div>
+ <div id="tabs2" class="tabs">
+ <h2>some dummy text</h2>
+ <div class="tabbody">
+ <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam malesuada suscipit pede. Nullam ipsum lacus, varius vel, nonummy in, consequat ut, neque. </p>
+ <h3>Lorem ipsum</h3>
+ <ul>
+ <li><a href="#dummy-text2">click here to show tab number 2</a></li>
+ <li><a href="#anything-else">click here to show tab number 3 in the other tab widget</a></li>
+ </ul>
+ <p>Nullam malesuada suscipit pede. Nullam ipsum lacus, varius vel, nonummy in, consequat ut, neque. Vivamus viverra. Duis dolor arcu, lacinia sit amet, sollicitudin sed, aliquet vel, quam. Pellentesque molestie laoreet tortor. Aenean quam. Pellentesque magna metus, venenatis sit amet, congue nec, dictum in, est. Aliquam nibh. </p>
+ </div>
+ <h2 id="dummy-text2">some more dummy text</h2>
+ <div class="tabbody">
+ <p>Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. </p>
+ <p>Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque</p>
+ </div>
+ <h2 id="anything-else2">anything else</h2>
+ <div class="tabbody">
+ <p>Here could be your content</p>
+ </div>
+ </div>
+
+ <h2>Usage</h2>
+ <pre><code>
+ $(document).ready(function(){
+ var tabs = $(".tabs").accessibleTabs({
+ tabhead:'h2',
+ fx:"fadeIn",
+ syncheights:true
+ });
+ <strong>$("a[href=#dummy-text]").click(function(e){ // make a link that points to #dummy-text open a tab
+ e.preventDefault(); // avoid the jumping of the page when clicking the anchor
+ tabs.showAccessibleTabSelector('#dummy-text'); //pass selector (id is easiest) of the tab to show
+ });</strong>
+ });
+ </code></pre>
+ <p class="about">
+ Want to learn more about this? <a href="http://blog.ginader.de/archives/2009/02/07/jQuery-Accessible-Tabs-How-to-make-tabs-REALLY-accessible.php">jQuery Accessible Tabs - How to make tabs REALLY accessible<br></a>
+ Or check out <a href="index.html">more Examples</a>
+ </p>
+ <script type="text/javascript">
+ //var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+ //document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+ </script>
+ <script type="text/javascript">
+ //var pageTracker = _gat._getTracker("UA-299719-2");
+ //pageTracker._initData();
+ //pageTracker._trackPageview();
+ </script>
+</body>
+</html>

0 comments on commit 14fe659

Please sign in to comment.
Something went wrong with that request. Please try again.