[英]Text box like search bar in Jquery Mobile
is there any way to create a text input just like search bar for Jquery Mobile. 有什么办法可以创建文本输入,就像Jquery Mobile的搜索栏一样。 For example when we type text there should be a cross mark which allows users to clear the field.
例如,当我们键入文本时,应该有一个叉号,允许用户清除该字段。
Even if I to use search bar as input field there is a search icon showing up and it doesn't seem nice and appropritate for a textbox. 即使我使用搜索栏作为输入字段,也会显示一个搜索图标,它看起来不太好,不适合文本框。
Can someone help me out. 有人可以帮我吗。 Thanks in advance
提前致谢
将data-clear-btn =“ true”添加到您的输入文本框
I think this is what you are looking for.The idea is to hide the icon in the search input. 我认为这就是您要寻找的。其想法是将图标隐藏在搜索输入中。
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>
<style>
.content .ui-icon-searchfield::after{
display:none !important;
}
.content .ui-input-search{
padding:0 10px !important;
}
</style>
</head>
<body>
<div data-role="page">
<div data-role="header">
<h1>Page Title</h1>
</div><!-- /header -->
<div data-role="content" class="content">
<input type="search" name="search" id="searc-basic" value="" />
</div><!-- /content -->
</div><!-- /page -->
</body>
</html>
A demo here - http://jsfiddle.net/8sg6M/ 此处的演示-http: //jsfiddle.net/8sg6M/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.