f02e21c8b6a7b6e747b8c6b1e47a2da91249c8b4.svn-base 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <% String path = request.getContextPath();%>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  7. <title>自动完成的文本框</title>
  8. <!--框架必需start-->
  9. <script type="text/javascript" src="<%=path%>/libs/js/jquery.js"></script>
  10. <script type="text/javascript" src="<%=path%>/libs/js/language/cn.js"></script>
  11. <script type="text/javascript" src="<%=path%>/libs/js/framework.js"></script>
  12. <link href="<%=path%>/libs/css/import_basic.css" rel="stylesheet" type="text/css"/>
  13. <link rel="stylesheet" type="text/css" id="skin" prePath="<%=path%>/"/>
  14. <link rel="stylesheet" type="text/css" id="customSkin"/>
  15. <!--框架必需end-->
  16. <!-- 自动完成框start -->
  17. <script type="text/javascript" src="<%=path%>/libs/js/form/autoComplete.js"></script>
  18. <!-- 自动完成框end -->
  19. <style>
  20. .complexAuto_input{
  21. height:18px;
  22. border:solid 1px #ffffff;
  23. background-color:transparent;
  24. padding-left:5px;
  25. }
  26. .complexAuto_search a{
  27. width:25px;
  28. height:25px;
  29. background-image: url(<%=path%>/libs/icons/minArrow.gif);
  30. background-repeat: no-repeat;
  31. background-position:50% 50%;
  32. text-indent:-3000px;
  33. display:block;
  34. }
  35. .complexAuto_search a:hover{
  36. background-image: url(<%=path%>/libs/icons/minArrowHover.gif);
  37. }
  38. .complexAuto_search{
  39. border:solid 1px;
  40. border-color:#999999 #C9C9C9 #B5B5B5 #B5B5B5;
  41. background-color:#ffffff;
  42. margin-right:-1px;
  43. position:relative;
  44. }
  45. .complexAuto_search_focus{
  46. background-color:#FFFFE1!important;
  47. box-shadow:0 0 6px rgba(0, 0, 0, 0.2);
  48. }
  49. .complexAuto_mark{
  50. color:#cccccc;
  51. position:absolute;
  52. cursor:text;
  53. }
  54. .complexAuto_Btn{
  55. border:0;
  56. width:50px;
  57. height:26px;
  58. background-image: url(<%=path%>/libs/images/demo/btn1.jpg);
  59. background-repeat: no-repeat;
  60. cursor:pointer;
  61. cursor:hand;
  62. }
  63. .complexAuto_BtnHover{
  64. background-image: url(<%=path%>/libs/images/demo/btn2.jpg)!important;
  65. }
  66. </style>
  67. </head>
  68. <body>
  69. <div class="height_10"></div>
  70. <table cellspacing="0" cellpadding="0" style="border-style:none;" id="complexAuto">
  71. <tr>
  72. <td class="ali01" style="border-style:none;padding:0;margin:0;">
  73. <div class="complexAuto_search">
  74. <label class="complexAuto_mark" id="complexAuto_mark">&nbsp;支持邮件全文搜索</label>
  75. <table cellspacing="0" cellpadding="0" style="border-style:none;">
  76. <tr>
  77. <td class="ali01" style="border-style:none;padding:0;margin:0;"><input type="text" class="complexAuto_input" keepDefaultStyle="true" id="input-11"/></td>
  78. <td class="ali01" style="border-style:none;padding:0;margin:0;"><a class="complexAuto_arrow" onclick="showSearchPanel()">箭头</a></td>
  79. </tr>
  80. </table>
  81. </div>
  82. </td>
  83. <td class="ali01" style="border-style:none;padding:0;margin:0;"><input type="button" class="complexAuto_Btn" id="complexAuto_Btn"/></td>
  84. </tr>
  85. </table>
  86. <div id="content" style="display:none;">
  87. <img src="<%=path%>/libs/images/demo/3.jpg"/>
  88. </div>
  89. <script type="text/javascript">
  90. function initComplete(){
  91. //综合示例
  92. //手动渲染自动完成框
  93. $('#input-11').AutoComplete({
  94. url: '<%=path%>/autoComplateAction.do?method=getListBySimulate163',
  95. matchName:"userName",
  96. inputWidth:200,
  97. boxWidth:230,
  98. onItemSelected: function(item){
  99. var msg = item.text();
  100. var value = msg.split(" ")[1];
  101. $('#input-11').val(value);
  102. top.Dialog.alert("此处进行搜索处理。" );
  103. }
  104. });
  105. //文本框处于焦点效果
  106. $("#input-11").focus(function(){
  107. $(this).parents(".complexAuto_search").addClass("complexAuto_search_focus");
  108. $("#complexAuto_mark").hide();
  109. });
  110. //文本框失去焦点效果
  111. $("#input-11").blur(function(){
  112. $(this).parents(".complexAuto_search").removeClass("complexAuto_search_focus");
  113. if($("#input-11").val()==""){
  114. $("#complexAuto_mark").show();
  115. }
  116. else{
  117. $("#complexAuto_mark").hide();
  118. }
  119. });
  120. //按钮移入移出效果
  121. $("#complexAuto_Btn").hover(function(){
  122. $(this).addClass("complexAuto_BtnHover");
  123. },function(){
  124. $(this).removeClass("complexAuto_BtnHover");
  125. });
  126. //水印点击隐藏
  127. $("#complexAuto_mark").click(function(){
  128. $("#input-11").focus();
  129. })
  130. }
  131. function showSearchPanel(){
  132. top.Dialog.open({InnerHtml: $("#content").html(),Title:"高级搜索",Style:"simple",Modal:false,Width:340,Height:310,Top:70,Left:20});
  133. }
  134. </script>
  135. </body>
  136. </html>