javascript - 如何创建具有自定义插入符号和文本行为的输入文本字段?

标签 javascript jquery html css

最近访问了一个壁纸分享网站 wallbase 。我首先注意到的是搜索框。文本输入框有一个漂亮的 css 渐变样式。但更有趣的是它的文本输入插入符号的行为。它是白色的,明亮的,有光泽的。此外,输入文本的行为也是自定义的。

我不知道它是如何实现的,我认为它可能与 CSS 和 JavaScript 一起实现。有人可以解释它的实现方式吗?我在下面附上截图:

enter image description here

最佳答案

这个插件可以帮助你Fancy Input – JQuery Plugin

<!-- ...previous page content... -->
<div>
 <input type='text' >
</div>
<div>
  <textarea></textarea>
</div>
<!-- ...some more content (hopefully)... -->
<script>
 $('div :input').fancyInput();
</script>

"Call the .fancyInput() function on all parents of inputs. With this example code, make sure every input is wrapped in a div."

关于javascript - 如何创建具有自定义插入符号和文本行为的输入文本字段?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21637423/

相关文章:

javascript - 使用变量在 jQuery 中设置 css 属性值

javascript - 如何使用 jQuery 和 XML 数据更改使用 CSS 的 HTML 元素?

html - Internet Explorer 8 忽略表格上的列组宽度

html - 如何平均缩小顶部和底部边距但保持中心菜单一致?

javascript - 为什么这个 Javascript RegExp 返回 true?

Javascript,将unicode字符串转换为Javascript转义?

javascript - HTTP POST -> 400 : Bad Request

javascript - 在 html2canvas 中将透明颜色更改为白色

jquery - 如何将 css 背景色仅应用于数据表单元格中的文本

html - 悬停时更改属性