简体   繁体   English

如何实现这种JavaScript效果?

[英]How to achieve this javascript effect?

On this website: when the user clicks "register now" along the top bar the screen goes dim and a box appears offering the registration form with recaptcha. 在此网站上:当用户单击顶部栏上的“立即注册”时,屏幕变暗,并出现一个框,其中提供带有Recaptcha的注册表格。 I have a registration form with recaptcha working on my site and would like to copy the effect seen above. 我在我的网站上有一个带有Recaptcha的注册表格,并希望复制上面看到的效果。

Can anyone link me to a specific tutorial offering instructions or alternatively provide me with the code? 谁能将我链接到提供说明的特定教程,或者为我提供代码?

I am a novice javascript programmer. 我是JavaScript新手。

Thanks if you can help me. 谢谢你能帮助我。

Take a look at jQuery effects , in case you haven't heard of jQuery before, here is a good introduction. 看一下jQuery 效果 ,以防您以前没有听说过jQuery, 这里有一个不错的介绍。

$('#register').click(function() {
  $('#topBar').fadeOut('slow', function() {
    // Some Code
  });
});

The effect you are talking about is generally described as a "lightbox" - based on one of the earliest implementations (from what I remember). 您所谈论的效果通常被描述为“灯箱”-基于最早的实现之一(据我所记得)。 Check out this page on wikipedia and look about - the modal dialog implementation might be what you're talking about. 在Wikipedia上查看此页面并查看-模态对话框实现可能就是您在说的。

I'm pretty sure some of the standard frameworks like jQuery and MooTools implement this (directly or via plugins). 我敢肯定,某些​​标准框架(如jQueryMooTools)都可以 (直接或通过插件)实现此功能。

There's couple of good plugins for that. 有几个不错的插件。 If you use jQuery you can check Thickbox and even jQuery UI Dialog should probably be enough for what you want. 如果您使用jQuery,则可以检查Thickbox ,甚至jQuery UI对话框也可能足以满足您的需求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM