Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/07/2010, 11:46
Vhyll
 
Fecha de Ingreso: octubre-2004
Ubicación: Lima, Perú
Mensajes: 185
Antigüedad: 19 años, 6 meses
Puntos: 1
Ayuda para ocultar div en JQuery despues de una busqueda

Buenas como el titulo lo dice ^^
Este es mi codigo
Código Javascript:
Ver original
  1. <script type="text/javascript">
  2.  
  3.  
  4. $(function() {
  5.  
  6.     $(".search_button").click(function() {
  7.         // getting the value that user typed
  8.         var searchString    = $("#search_box").val();
  9.         // forming the queryString
  10.         var data            = 'search='+ searchString;
  11.  
  12.         // if searchString is not empty
  13.         if(searchString) {
  14.             // ajax call
  15.             $.ajax({
  16.                 type: "POST",
  17.                 url: "rpc.php",
  18.                 data: data,
  19.                 beforeSend: function(html) { // this happens before actual call
  20.                     $("#results").html('');
  21.                     $("#searchresults").show();
  22.                     $(".word").html(searchString);
  23.                },
  24.                success: function(html){ // this happens after we get results
  25.                     $("#results").show();
  26.                     $("#results").append(html);
  27.               }
  28.             });
  29.         }
  30.         return false;
  31.     });
  32. });
  33. function fill(thisValue) {
  34.         $('#titulo_id').val(thisValue);
  35.         setTimeout("$('#suggestions').hide();", 200);
  36. }
  37.    
  38. </script>

Código HTML:
Ver original
  1. <input type="text" name="search" id="search_box" class='search_box'/>
  2. <input type="submit" value="Search" class="search_button" /><br />
  3. <input name="titulo_id" value=" " id="titulo_id" onblur="fill();" class="text-input"/>><br />
  4. <div id="searchresults" >Search results for <span class="word"></span></div>
  5. <ul id="results" class="update">
  6. </ul>
BUeno aca les dejo el codigo me permite buscar titulo en la base de datos con PHP y al hacer click en el div del buscador el titulo ingresa al otro input "titulo_id" lo que yo kiero hacer es q' cuando haga click en titulo buscado tambien se cierre el div del buscador.
Saludos y gracias
__________________
VkManga.Com
De todo un Poco