-2
$( document ) . ready( function () {
$( 'div#bloqueioSelect' ) . click( function () {
if ( $( 'div#bloqueioSelect ul' ) . is( ':visible' ) )
$( 'div#bloqueioSelect ul' ) . css( 'display', 'none' );
else
$( 'div#bloqueioSelect ul' ) . css( 'display', 'block' );
} );
$( 'div#bloqueioSelect ul li' ) . click( function () {
$('input[type=hidden]#bloqueio'). val( $(this) . val() );
alert($('input[type=hidden]#bloqueio'). val());
} );
} );
div.selecao {
width: 100px;
border: 1px #CCCCCC solid;
}
div.selecao div {
display: inline-block;
height: 30px;
line-height: 30px;
text-align: center;
}
div.selecao div:after {
width: 40px;
height: 30px;
background: url("seta.jpg") no-repeat right #ddd;
}
div.selecao div,
div.selecao ul {
display: block;
width: 100%;
background-color: #F8F8F8;
border-top: 1px #CCCCCC solid;
}
div.selecao ul {
display: none;
padding: 0;
margin: 0;
}
div.selecao ul li img {
float: left;
}
div.selecao ul li {
display: block;
width: 100%;
height: 30px;
cursor: pointer;
border-top: 1px #CCCCCC solid;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input type=hidden value=' . $busca->getBloqueio() . ' name=bloqueia id=bloqueia />
<div class=selecao id=bloqueiaSelect>
<div>Bloqueia</div>
<ul>
<li value=1><img src="imgs/bloquear.png" style="height:30px" title="Bloquear Produto" /></li><!--
--><li value=0><img src="imgs/desbloquear.png" style="height:30px" title="Desbloquear Produto"/></li>
</ul>
</div>
<br />
<input type=hidden value=' . $busca->getBloqueio() . ' name=bloqueio id=bloqueio />
<div class=selecao id=bloqueioSelect>
<div>Bloqueio</div>
<ul>
<li value=1><img src="imgs/bloquear.png" style="height:30px" title="Bloquear Produto" /></li><!--
--><li value=0><img src="imgs/desbloquear.png" style="height:30px" title="Desbloquear Produto"/></li>
</ul>
</div>
The goal here is add one seta.jpg
in div
as after
but is appearing to arrow.
Where am I going wrong?
After some changes guided by colleague Lucas... I arrived in:
div.selecao div::after {
display: inline-block;
content: url("seta.jpg");
width: 30px;
height: 30px;
}
Blocks needs to center vertically and horizontally and the arrow needs to go all the way to the right.
Have you checked if an error appears in the Console if the image was not found? Have you checked if it is seven.jpg? Usually these images are . PNG or . GIF
– hugocsl
Ooh, yes I’ve seen it!
– Carlos Rocha