I've already seen some similar posts but I think my case is different. I have the following code:
$(".imagem .bottom-buttons").on("click", ".ver-emb", function(event){
var Image = <?php echo $row->embalagem; ?>;
//row-embalagem comes from a query search to the database.
$(".slider-img").css("background-image", "url(../assets/imagens/<?php echo $row->embalagem; ?>)");
$(this).addClass( "ver-prod" );
$(this).removeClass( "ver-emb" );
$(this).text( "Ver Produto" );
});
I've read that you need to put the php variable into jquery variable, but how do I apply that new Jquery variable to the background-image url ?