我如何使用CSS和JavaScript编写这个真棒发光的边框效果? [英] How can I code this awesome glowing border effect with CSS and JavaScript?

查看:143
本文介绍了我如何使用CSS和JavaScript编写这个真棒发光的边框效果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您专注于其中一个字段时,此表单具有非凡的效果:

This form has an awesome effect when you focus on one of its fields:

http://labs.dragoninteractive.com/panel/demo/

任何有关如何重新创建的线索?下面是我的一些意见:

Any clues on how I can recreate this? Here are a few of my observations:

  • I see they have a giant colorful image here: http://labs.dragoninteractive.com/panel/demo/lib/img/form/map/rmap.jpg
  • When you focus on the form the color seems to fade in (and fades away on blur)
  • I don't know how they are getting the soft edge (glow) using the source image they have
  • I don't know how they are panning the colorful image across the border infinitely
  • The markup seems pretty messy; ideally I'd want a simpler solution than what they have
  • This one is a clone made all with CSS3, but I don't like how the outer glow doesn't stay uniform

推荐答案

颜色变化动作发生在rmap.jpg(非常大的彩色图像)的位置是动画。有一个.png与alpha透明度,作为哑光rmap.jpg,创建漂亮的柔和的颜色过渡。动画是使用jQuery处理的。

The color changing action occurs as the position of rmap.jpg (the very large colorful image) is animated. There is an .png with alpha-transparencies which acts as matte over rmap.jpg, creating the nice soft color transition. The animation is handled using jQuery.

Peter Schmalfeldt 创建了一个演示,该演示也是可下载

Peter Schmalfeldt created a demo which is also downloadable.

这篇关于我如何使用CSS和JavaScript编写这个真棒发光的边框效果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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