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

查看:31
本文介绍了我的 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.

第一部分

有两种形式.第二种形式是不可见的,因为它的类设置为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.

如果可以,请帮忙.

非常感谢!

推荐答案

给你.这是一个更新和工作的.希望你能说出区别,如果你有什么不明白的地方,请告诉我

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天全站免登陆