Start with a tab based on url
How can I make the UI tabs start with a tab definded by php
so if a go to a page with a uri of http://example.com/page.php?tab-17
i want the tab-17 to be displayed
i managed to get the uri but i don't really know what to do next
the $url[1] is the tab-17
- <?php
- $page = $_SERVER['REQUEST_URI'];
- $url = explode("?", $page);
- ?>
- <script type="text/javascript">
- $(document).ready(function() {
- $("#tabs").tabs();
- <?php
- if ($url[1] == "") {
- echo "$('div.ui-tabs:first-child').removeClass('ui-tabs-hide');";
- } else {
- echo "$('div.ui-tabs:first-child').tabs({disabled: true});
- $('div#$url[1]').tabs('enable');";
- }
- ?>
- });
- </script>
Any help would is appreciated!
Kajusz