jQuery load()“冲突"与slideToggle() [英] Jquery load() "conflicts" with slideToggle()

查看:130
本文介绍了jQuery load()“冲突"与slideToggle()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Jquery load()加载DIV中的外部页面,到目前为止,问题是,在这些外部页面之一中,我需要执行slideToggle效果,但是根本不起作用,我相信这是因为load().这是我正在使用的一些代码.

I am using Jquery load() to load external pages inside a DIV, so far so good, the problem is, in one of these external pages I need to do a slideToggle effect but it doesn't work at all, I believe it's because the load(). here's some code I am using.

这是项目本身. http://www.universidadedoingles.com.br/apamagis/apamagis/teste.html

在左侧菜单上,单击CADASTRO,然后单击NOVO ASSOCIADO,这是一个外部页面,顶部是灰色锚PRINCIPAL,当用户单击此处时,它必须滑动我所拥有的表单.

On the left menu, click on CADASTRO, then NOVO ASSOCIADO, this is an external page, at the top there is an gray anchor PRINCIPAL, when the user clicks there it must slide a form I have.

如果您只想查看外部页面,就在这里.

If you guys want to check just the external page, here it is.

http://www.universidadedoingles.com.br/apamagis/apamagis/novoassociado.html

上面的链接正常工作,但是当我在项目内部并使用load()调用它时,没有任何反应.

This link above, works properly, but when I am inside the project and call it using load() nothing happens.

如果您想知道,这是我如何加载页面和幻灯片. 这会加载我遇到问题的页面

In case you're wondering, here's how I am loading the pages and slide. This loads the page I'm having problems

        $("#novoAssociado").click(function() {
        $("#principal").load("novoassociado.html");
    });

这是用于滑动内容的代码

This is the code to slide the content

<script type="text/javascript">
$("document").ready(function() {
    $("#dadosPessoais").click(function() {
        $("#one").slideToggle();
    });

    $("#localizacaoAnchor").click(function() {
        $("#localizacaoContent").slideToggle();
    });
});

推荐答案

<script type="text/javascript">
$("document").ready(function() {
    $("#dadosPessoais").live('click', function() {
        $("#one").slideToggle();
    });

    $("#localizacaoAnchor").live('click', function() {
        $("#localizacaoContent").slideToggle();
    });
});

尝试(实时)

这篇关于jQuery load()“冲突"与slideToggle()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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