Created
April 2, 2012 04:08
-
-
Save emayk/2280638 to your computer and use it in GitHub Desktop.
jquery : sample load jquery ui with partial content
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $('#tabs').tabs({ | |
| select: function(event, ui) { | |
| var $tabAnchor = $(ui.tab); | |
| if (ui.index == 0 && !$tabAnchor.data('completed')) { | |
| $($tabAnchor.attr('href')).load($tabAnchor.data('content-url'), function() { | |
| // indicate the content has been loaded | |
| $tabAnchor.data('completed', true); | |
| }); | |
| } | |
| } | |
| }); | |
| <div id="tabs"> | |
| <ul> | |
| <li><a href="#tabs1" data-content-url="/page #content">Tab Head</a></li> | |
| <li><a href="#tabs2">Tab 2</a></li> | |
| </ul> | |
| <div id="tabs1"></div> | |
| <div id="tabs2">...</div> | |
| </div> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment