mercredi 5 octobre 2016

Jquery Tabs is throwing error or is not working

Vote count: 0

I am trying to change the default tab to the active tab after I save the page so the client doesn't get mad.

I am using this code:

<cfif isDefined('url.activePage')>
<script>
    <cfoutput>
        var #toScript(url.activePage,'activeTab')#;
    </cfoutput>
    $(document).ready(function () {
        var index = $('.tabs a[href="#'+activeTab+'"]').parent().index();
        $(".tabs").tabs("option", "active", index);
    });
</script>

It is giving me this error:

Uncaught error: cannot call methods on tabs prior to initialization; attempted to call method 'option'

I edit my code to this:

$(".tabs").tabs({active:index});

It doesn't throw an error anymore, but it's not loading my active tab.

What am I doing wrong?

asked 2 mins ago

Let's block ads! (Why?)



Jquery Tabs is throwing error or is not working

Aucun commentaire:

Enregistrer un commentaire