[EMAIL PROTECTED] wrote:
Hi,

I'm trying to create some AJAX tabs that load a PHP page subject to a
parameter.  However, whenever I roll over my tabs, or click on one of
them, they attempt to load something called "remote-tab-n" where "n"
is the sequence of where the tab occurred.  However, I haven't put
this string anywhere in my code.  What am I doing wrong?  Here is what
I have:

<html>
<head>
<link type="text/css" href="jquery.tabs.css" rel="stylesheet">
<script src="scripts/jquery-1.1.2.pack.js" type="text/javascript"></
script>
<script src="scripts/jquery.history_remote.pack.js" type="text/
javascript"></script>
<script src="scripts/jquery.tabs.pack.js" type="text/javascript"></
script>
<script type="text/javascript">

$(document).ready(function(){
        // create AJAX tabs
        $('#container').tabs({
             remote: true,
             onShow: function(clicked, shown, hidden) {
                 // alert( $('li', shown).size() );
             }
        });
});

</script>
</head>
<body>

<div id="container"><ul>
<li><a href="draw_modules?tab_id=1">General</a></li>
<li><a href="draw_modules?tab_id=2">Math</a></li>
<li><a href="draw_modules?tab_id=4">Social Studies</a></li>
<li><a href="draw_modules?tab_id=5">Reading</a></li>
<li><a href="draw_modules?tab_id=6">Learning Management</a></li>
<li><a href="draw_modules?tab_id=9">New Tab</a></li>
                                </ul></div>
</body>
</html>

Thanks for any advice, - Dave



The plugin needs to change the existing links to hashes to be able to support history and bookmarking. This is by default done with the prefix "remote-tab-" plus a simple counter.

You can change the default with the option hashPrefix, like so:

$('#container').tabs({
    remote: true,
    hashPrefix: 'draw_module_'
});

That would result in links pointing to "#draw_module_1", ...

I'm planning for a little longer to retrieve that generated hash from the link text and/or its title attribute, but currently I have absolutely no time to work on a robust solution.


HTH, Klaus

Reply via email to