搜索文本框的占位符 [英] Placeholder for Search-Textbox

查看:675
本文介绍了搜索文本框的占位符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我相信任何人都知道搜索文本框的这种占位符行为. 加载页面后,其中会出现一个字符串,如在这里搜索...",并且用户将其插入文本框后,该字符串就会消失,并且如果用户在单击时没有插入任何内容,则会再次显示该字符串.此文本框.

I belive anybody knows this Placeholder-Behaviour for Search-Textboxes. When the page is loaded there is a string in it like "search here..." and as soon the user klicks into the TextBox the string diappears and it appears again if the user didn't insert somethink as soon as the user klick out this textbox.

此刻,我使用JQuery Placeholder-Plugin在我的ASP.Net-Page中实现这一点.

At the moment I use the JQuery Placeholder-Plugin to realize that in my ASP.Net-Page.

我有一个问题,也许插件不支持我想要的东西,也许它不知道:

I heave a questions, maybe the Plugin doesn't support what I want, maybe it does, don't know:

我将在文本框中显示一个图像,而不是playceholder-text的字符串. (背景是,文本框是Google搜索,我希望使用漂亮的彩色Google文本,而不是无聊的单色在这里使用google搜索..:".)

I will have a Image within the Textbox instead of a string for the playceholder-text. (Background is, the TextBox is a Google-Search and I want to have the nice colored Google-text instead of a boring single-color "search with google here..:").

有什么想法吗?

推荐答案

我在JQuery中为此编写了一个插件,为了咯咯地笑,我在这里发布了该插件: "jQuery插件"页面.

I wrote a plugin for this in JQuery which, for giggles, I released here: Jquery Plugin page.

由于某种原因,我将其称为默认框.那是因为它使用了文本框的dom默认值.也许这对您有帮助?

For some reason I called it default box. That's because it uses the dom default value of the textbox. Maybe this will help you?

这篇关于搜索文本框的占位符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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