我的jquery小提琴不起作用 [英] my jquery fiddle isn't working

查看:60
本文介绍了我的jquery小提琴不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的小提琴只显示了我想要做的部分内容,但由于我甚至无法让第一部分工作,我没有尝试添加第二部分。

My fiddle only shows part of what I'm trying to do, but since I can't even get the first part to work, I didn't try to add the second part.

第一部分

有2种表格。第二种形式是不可见的,因为它的类被设置为display:none;

There's 2 forms. the second form is invisible because its class is set to "display: none;"

我想要做的是,当你在第一张表格上点击发送时,它淡出,然后类在form2上更改,以便它变得可见。

What I want to do is, when you hit "send" on the first form, it fades out, and then the class changes on form2 so that it becomes visible.

我的小提示显示我对此 http:/的微弱尝试/jsfiddle.net/mjmitche/KvwGw/

My fiddle shows my feeble attempt at this http://jsfiddle.net/mjmitche/KvwGw/

注意,我是新手,所以请尽可能多地提供解释。 (注意,我没有在小提琴中创建适当的形式,因为不知道在哪里发布它们等)

Note, I'm a newbie so please provide as much explanation as possible. (Note, I didn't create proper forms in the fiddle because didn't know where to post them etc)

第二(未尝试)部分

在第二个表单上点击发送后,我想要一个回调函数,它也会淡出第二个表单。

Once the send is clicked on the second form, I want a call back function that fades the second form out as well.

如果可以,请提供帮助。

Please help if you can.

非常感谢!

推荐答案

你走了。这是一个更新和工作的。希望你能说出不同之处,让我知道你有什么不明白的地方

Here you go. Here is an updated and working one. Hopefully you can tell the difference, let me know if there is anything you don't understand

http://jsfiddle.net/KvwGw/2/

第二部分

$('#form2').submit(function() {
    // add form submit stuff in there

    $(this).fadeOut(); //fades out form
    return false; //prevents form from submitting to the form action

});

这篇关于我的jquery小提琴不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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