未捕获的异常:无法在初始化之前调用选项卡上的方法 [英] uncaught exception: cannot call methods on tabs prior to initialization

查看:251
本文介绍了未捕获的异常:无法在初始化之前调用选项卡上的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下代码更改选项卡上的标签颜色

I am using the following code to change the tab color on click

  $("ul.tabs").tabs("> .pane");

但它会抛出错误

未捕获的异常:在初始化之前无法在选项卡上调用方法;试图调用方法'> .pane',有人可以帮我解决这个错误吗?

uncaught exception: cannot call methods on tabs prior to initialization; attempted to call method '> .pane', could somebody help me with this what is this error?

推荐答案

它很直接正如例外所说。必须先初始化选项卡,然后才能对其进行操作。所以初始化它们。

Its pretty straight forward as the exception says. Your tabs must be initialized before you can work on them. So initialize them.

function(){
$("ul.tabs").tabs();
}

或只需使用

$("ul.tabs").tabs().tabs($("div.panes > div"), action);

这篇关于未捕获的异常:无法在初始化之前调用选项卡上的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆