如何在HTML文本输入字段周围添加类似Twitter的淡入淡出效果?

Ste*_*rgh 4 jquery textbox textinput glow fadein

我知道输入字段周围的光芒是标准的,但Twitter设法顺利淡化它.我一直在环顾四周,但似乎无法找到实现这一目标的可靠方法.这是怎么做到的?

Moi*_*man 6

以下是twitter的用法:

HTML:

  <p class="search-holder" style="opacity: 0.6;">
    <label for="searchform_q">Search for a keyword or phrase…</label>
    <input type="text" tabindex="8" size="30" name="q" id="searchform_q" class="round-left" accesskey="/"><input type="submit" value="Search" tabindex="9" name="commit" id="searchform_submit" class="submit round-right">
  </p>
Run Code Online (Sandbox Code Playgroud)

jQuery的:

  $('.search-holder').mouseenter(function(){
        $(this).animate({opacity:1});
  }).mouseleave(function(){
        $(this).animate({opacity:0.6});
  });
Run Code Online (Sandbox Code Playgroud)