点搜索按钮div后 自动执行搜索


<div class="shousuo_po">
     
      	<a href="{:U('lists')}" class="shousuo_po_1">
			<button type="button" class="btn btn-default fl_btn">
				<span class="fl_ing_wh"><img src="{:CUSTOM_TEMPLATE_PATH}Index/index/img/sdh.jpg"></span>
			</button>
		</a>
     
		<form action="#"> 
			<input type="search" class="form-control ss_input shousuo_po_2" id="firstname" placeholder="搜索全部产品"/> 
	    </form>

		
		<script>
				$("#firstname").keyup(function(){
				if(event.keyCode == 13){
					//这里写你要执行的事件;
					var info=$(this).val();
					window.location.href="index.php?s=/addon/Weixxx/Weixxx/find/keyword/"+info;//你可以跟换里面的网址,以便成功后跳转
				}
				});
				
				
				       
   				$(document).ready(function() {
						
                $('.myflexslider').flexslider({

                        controlNav: true, 

                        directionNav: false,

                        animation: "slide",

                        //manualControls: ".myflexslider .slidenav"

                    });

          });	
		</script>
      
      <div class="clearfix"></div>   
   </div>




<script>
	$(".shousuo_po").on("click", function(){
	   var info=$("#firstname").val();
	   window.location.href="index.php?s=/addon/Weixxx/Wexxxx/find/keyword/"+info;//你可以跟换里面的网址,以便成功后跳转
	});
  </script>
 


你可能感兴趣的:(点搜索按钮div后 自动执行搜索)