I'm doing a product query that pulls the item
of a database. At the moment of giving click
in a link this shows a content.
What happens is that these item
are within a bucle While
. What I want is to get that by clicking on more info the product information is displayed.
For this I require the content of a variable to be within a selector JQuery
.
I would like to know what the syntax would be.
I have the following code:
<div class="informacion">
<p class="info_pro col-md-6"><a href="#enlace<?php echo $fila[ind];?>" class="enlace_detalles">VER DETALLES</a></p>
<p class="icon_call col-md-6">
<a href="tel:013095009"><i class="fa fa-phone"></i></a>
<a href="mailto:[email protected]"><i class="fa fa-envelope-o"></i></a>
</p>
</div>
<div id="enlace<?php echo $fila[ind];?>" class="detalles_p">
<div class="detalle_img">
<img src="<?php echo"$fila[ruta]"; ?>" class="img-responsive">
</div>
<div class="detalles_info">
<p><i class="detalle_item">INDICE:</i><?php echo"$fila[ind]" ?></p>
<p><i class="detalle_item">MATERIAL:</i><?php echo"$fila[material]" ?></p>
<p><i class="detalle_item">CANTIDAD:</i><?php echo"$fila[cantidad]" ?></p>
<p><i class="detalle_item">IMPRESIÓN:</i><?php echo"$fila[impresion]" ?></p>
<p><i class="detalle_item">TAMAÑO:</i><?php echo"$fila[tamano]" ?></p>
<p><i class="detalle_item">PRESENTACIÓN:</i><?php echo"$fila[presentacion]" ?></p>
<p><i class="detalle_item">SERVICIO DE ENTREGA:</i><?php echo"$fila[servicio]" ?></p>
</div> en<?php echo $fila[ind];?>
<div class="detalles_bn">
<a href="tel:013095009">Llama al proveedor <i class="fa fa-phone"></i></a>
<a href="mailto:[email protected]">Solicitar cotización <i class="fa fa-envelope-o"></i></a>
<p>"SpamBot Automatic: Opps!!, Este servicio borra automáticamente todos los correos de servidores gratuitos, por lo que agradeceremos enviar su requerimiento desde su correo corporativo."</p>
</div>
</div>
And this is my Jquery .
$(".enlace_detalles").click(function(){
var href= $(this).attr('href');
var hrefnew="'"+ href + "'";
Aqui es donde no se como llamar a mi variable?
});
Let's see to make it more accurate ... I want to put the contents of a variable inside a Jquery selector ... How do I do it?
$ (".link_details"). click (function () { var href = $ (this) .attr ('href'); var hrefnew="'" + href + "'"; $ (hrefnew) .slideUp ("slow"); < --- This is what is not done ... });
The class ".link_details" is the link that opens the div that contains the info ... but being in a loop ... I click on this link and all divs open or close. and what I want is that if I click on item1 I open the item1 detail ... if I click on item2 I open the item2 detail and so on.