单击链接时,如何使文本框发光然后褪色? [英] How do I make a text box glow then fade when a link is clicked?

查看:100
本文介绍了单击链接时,如何使文本框发光然后褪色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使页面底部的文本框更明显-我将如何建立一个链接,当单击该链接时,将浏览器移至页面底部,然后使文本框在页面周围发光边缘然后褪色(如在发光脉冲中一样,我不想文本框褪色!)?

I'm trying to make a text box at the bottom of a page more obvious - how would I go about making a link which when clicked moves the browser to the bottom of the page and then makes the text box glow around the edges then fades (as in the glow pulses, I don't want the text box to fade!)?

推荐答案

我为您提供了一个粗略的实现.它使用突然的锚定标记单击将您移至文本框,但是,您可以使用jQuery的动画功能使其美观.它确实具有您想要的脉冲效果.

I have a crude implementation for you. It uses the abrupt anchor tag click to move you to the text box, however, you could use jQuery's animate function to make it pretty. It does have the effect with the pulse you wanted.

http://jsfiddle.net/pBg6U/

$(function() {
    $("#glow-trigger").on('click', function(e) {
        var glower = $('.glow');
        window.setInterval(function() {  
            glower.toggleClass('active');
        }, 1000);
    });
});

这篇关于单击链接时,如何使文本框发光然后褪色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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