【问题标题】:Jquery in page tabs using iframe使用 iframe 的页面选项卡中的 Jquery
【发布时间】:2011-09-08 03:43:07
【问题描述】:

由于某种原因,我的标签页上的 jquery 无法正常工作,它在我正在加载的实际链接上运行良好。

这是在标头中使用的 JS:

<script type="text/javascript" src="js/jquery.easing.1.3.min.js"></script>
<script type="text/javascript" src="js/royal-slider-2.0.js"></script>   
<script type="text/javascript" src="js/jquery.xdomainajax.js"></script>

<script>
    $(function() {  
        $.internshipSlider = new RoyalSlider("#internshipPrograms", {
            directionNavEnabled:true,
            directionNavAutoHide:false,
            controlNavEnabled:false,
            welcomeScreenEnabled:false
        });

        $.internshipSlider.settings.beforeSlideChange = function() {
            // change the "active" state for the slide in the nav
            $("#nav"+this.lastSlideId).removeClass("active");
            $("#nav"+this.currentSlideId).addClass("active");
        }

        $.internshipSlider.settings.afterSlideChange = function() {
            //currently not doing anything after slide change
        }





    function sliderChange(slideIndex) {
        // public function for changing the slides via a link
        $.internshipSlider.goTo(slideIndex);
    }



    /* --- EXPANDED TEXT --- */
    var hiddenText = true;
    function toggleExpandedText () {
        if (hiddenText) {
            $("#text-box-expanded").show("blind");
            $("#moreTextBtn").text("Hide...");
            hiddenText = false;
        } else {
            $("#text-box-expanded").hide("blind");
            $("#moreTextBtn").text("More...");
            hiddenText = true;
        }
    }




</script>

我是否错过了将其加载到页面以使其工作的步骤? DOM 有问题?抱歉,我对此很陌生,并且承受着快速完成这项工作的压力。感谢您对此的任何帮助...

谢谢!

【问题讨论】:

  • 我没有看到调用 jQuery 本身的脚本元素。您是否忽略了将其放在帖子中?此外,最好将您的代码包装在 ready() call

标签: jquery tabs facebook-iframe iframe-app


【解决方案1】:

在 Chrome 调试器工具中检查您的 javascript 控制台是否有错误,并确保实际上引用了 jquery,因为它不在您发布的代码中。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多