jQuery和语法荧光笔在动态加载的选项卡上不起作用

阿迪卡里

我的问题是我在网站上使用了jQuery UI选项卡。选项卡中的内容是动态加载的,或者您可以说,每当我单击选项卡时,选项卡显示面板中就会显示另一个html页面。

但是真正的问题出现在每当我想在标记中加载包含Java代码的html页面时,我都在使用语法突出显示工具设置语法样式。

在浏览器中调试时,我通常会因为

不能在同一帧中两次加载XregExp

提前致谢。

我正在使用jQuery选项卡动态加载页面的HTML页面

<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="indexLayout.css" />
<link rel="stylesheet" href="navMenu.css" />
<link rel="stylesheet" href="css/jquery-ui-1.10.3.css" />
<script src="js/jquery-1.9.1.js"></script>
<script src="js/jquery-ui.js"></script>
<script src="highlighter/shCore.js"></script>
<script src="highlighter/shBrushJava.js"></script>
<link href="highlighter/shCore.css" rel="stylesheet" type="text/css" />
<link href="highlighter/shThemeDefault.css" rel="stylesheet"
    type="text/css" />
<script>
    $(function() {
        $("#tabs").tabs().addClass("ui-tabs-vertical ui-helper-clearfix");
        $("#tabs li").removeClass("ui-corner-top").addClass("ui-corner-left");
    });

    $("#tabs").tabs({
        load : function(event, ui) {
            $("#tabs").find("a").live('click', function() {
                $(ui.panel).load(this.href);
                return false;
                console.log(this.href);
            });
        },
        select : function(event, ui) {
            $("#tabs").find("a").die('click');
            $("#tabs").find("a").live('click', function() {
                $(ui.panel).load(this.href);
                return false;
            });
        }
    });
</script>
<style>
#tabs {
    width: 100%;
    font: 14px/1.5 Trebuchet MS, sans-serif;
}

.ui-tabs-vertical {
    width: 55em;
}

.ui-tabs-vertical .ui-tabs-nav {
    padding: .2em .1em .2em .2em;
    float: left;
    width: 12em;
    margin-top: 20px;
    background: white;
}

.ui-tabs-vertical .ui-tabs-nav li {
    clear: left;
    width: 100%;
    border-bottom-width: 1px !important;
    border-right-width: 0 !important;
    margin: 0 -1px .2em 0;
    border-radius: 0px;
}

.ui-tabs-vertical .ui-tabs-nav li a {
    display: block;
}

.ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active {
    padding-right: .1em;
    border-right-width: 1px;
    text-decoration: underline;
    text-shadow: aqua;
}

.ui-tabs-vertical .ui-tabs-panel {
    padding: 1em;
    float: left;
    width: 74%;
    text-align: justify;
}

.ui-widget-content {
    border: 0px;
}

.ui-helper-reset {
    line-height: 1;
}

ul.tabs li.ui-state-active,ul.tabs li.ui-tabs-selected {
    color: red;
}

ul.tabs li.ui-tabs-active a,ul.tabs li.ui-tabs-selected a {
    color: red;
}
</style>
</head>
<body>
    <div id="container">
        <div id="upper-menu"></div>
        <header id="header-wrap">
            <header> </header>
        </header>
        <nav>
            <ul>
                <li><a href="index.jsp"><span>home</span></a></li>
                <li><a href="tutsPage.html"><span>about</span></a></li>
                <li><a href="tutsPage.html"><span>contact</span></a></li>
                <li><a href="tutsPage.html"><span>java</span></a></li>
                <li><a href="tutsPage.html"><span>Database</span></a></li>
                <li><a href="tutsPage.html"><span>C/C++</span></a></li>
                <li><a href="tutsPage.html"><span>Blender</span></a></li>
            </ul>
        </nav>

        <div id="content-container">
            <section>
                <div id="tabs">
                    <ul>
                        <li><h2 style="color: blue; text-align: center;">Topics
                            </h2></li>
                        <li><a href="#tabs-1">Introduction</a></li>
                        <li><a href="webpages/java/testPage1.html">Page 1</a></li>
                        <li><a href="webpages/java/testPage2.html">Page 2</a></li>
                        <li><a href="webpages/java/testPage3.html">multithreading</a></li>
                        <li><a href="webpages/java/testPage4.html">test for code</a></li>
                    </ul>
                    <div id="tabs-1">
                        <h2></h2>
                        <p></p>
                    </div>
                </div>
            </section>
            <aside>
                <div id="inside-aside-content-area">
                    <h1></h1>
                    <p></p>
                </div>
                <div id="inside-aside-content-area">
                    <h1></h1>
                    <p></p>
                </div>


            </aside>
        </div>
        <script type="text/javascript">
            SyntaxHighlighter.all()
        </script>
        <footer id="footer-wrap">
            <center>
                &copy <i>copyright reserved</i> @<b> kailash adhikari</b>
            </center>
            <hr>
            <footer> </footer>

        </footer>
    </div>
</body>
</html>

我使用的语法高亮页面有一些Java代码:

<!DOCTYPE html>
<html><head>
<script type="text/javascript" src="highlighter/shCore.js"></script>
<script type="text/javascript" src="highlighter/shBrushJava.js"></script>
<link href="highlighter/shCore.css" rel="stylesheet" type="text/css" />
<link href="highlighter/shThemeDefault.css" rel="stylesheet" type="text/css" />
</head>
<body>
<pre class="brush: java">

        function foo(){
        }
    </pre>
<script type="text/javascript">
    SyntaxHighlighter.all()
</script>

</body>
</html>
克里斯蒂安德夫

我可以看到您.live()在代码中使用,并且since version 1.7它已被替换为.On,并且您正在使用1.9.1 ...

<script src="js/jquery-1.9.1.js"></script> 

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

jQuery和语法荧光笔在动态加载的选项卡上不起作用

来自分类Dev

语法荧光笔不起作用

来自分类Dev

jQuery选项卡不起作用

来自分类Dev

jQuery选项卡不起作用

来自分类Dev

单击事件在选项卡上不起作用

来自分类Dev

带选项卡图标顶部的离子选项卡在Android和IOS上不起作用

来自分类Dev

使用jquery动态添加时,选项卡不起作用

来自分类Dev

JQuery-ui选项卡-重新加载带有全新内容的页面不起作用

来自分类Dev

登录和注册选项卡不起作用 xml

来自分类Dev

jQuery tabselect在单击选项卡时不起作用

来自分类Dev

jQuery UI选项卡beforeLoad preventDefault不起作用

来自分类Dev

jQuery UI选项卡效果不起作用

来自分类Dev

jQuery UI选项卡选择方法不起作用

来自分类Dev

jQuery选项卡不起作用或引用错误?

来自分类Dev

jQuery UI选项卡beforeLoad preventDefault不起作用

来自分类Dev

jQuery选项卡ui不起作用

来自分类Dev

jQuery tabselect在单击选项卡时不起作用

来自分类Dev

jQuery和CSS图像居中在选项卡中不起作用

来自分类Dev

jQuery .click在动态加载的按钮上不起作用

来自分类Dev

使用jquery语法荧光笔突出显示html textarea内的Java代码

来自分类Dev

选项卡的keyCode不起作用

来自分类Dev

Emacs选项卡不起作用

来自分类Dev

引导选项卡不起作用

来自分类Dev

Codeigniter set_value在其他选项卡上不起作用

来自分类Dev

jqgrid:onchange事件在本地网格的选项卡上不起作用

来自分类Dev

链接在 Facebook 页面自定义选项卡上不起作用

来自分类Dev

Bootstrap 在 android 上的普通 Firefox 选项卡上不起作用

来自分类Dev

语法荧光笔:找不到XML笔刷

来自分类Dev

Web代码的语法荧光笔,例如html,php,css

Related 相关文章

热门标签

归档