Ich habe diesen NUMBERPICKER. Aber ich will nicht, dass die Zahlen in der Box im section_room angezeigt werden, bis sie ausgewählt sind. Bis dahin möchte ich ein backgroudImage (Platzhalter) haben.Custom NumberPicker - Optimierung
<div class="section_room">
<select id="persons" type="text" placeholder="" onchange="hideIcon(this);">
<option value="null">1</option>
<option value="null">2</option>
<option value="null">3</option>
<option value="null">4</option>
</select>
</div>
<script>
function hideIcon(self) {
self.style.backgroundImage = 'none';
}
</script>
#persons {
background-image: url(../images/icn_person1_dark.png);
background-size: 40% 80%;
background-repeat: no-repeat;
background-position: center;
}
select {
float:right;
width: 20%;
height: 44px;
color: #858585;
font-size: 0.8725em;
outline: none;
font-family: 'Open Sans', sans-serif;
background: #ffffff;
border-color:darkgrey;
border-style: solid;
border-radius: 2px;
outline: none;
-webkit-appearance: none;
-moz-appearance: none;
text-indent: 1px;
}
select option {
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
Welches Problem haben Sie, speziell? Ihr Skript sollte auch nicht innerhalb Ihres '
Mein Problem ist, dass der section_room immer die Nummer 1 hat und ich möchte ein backgroudImage (Platzhalter) haben, bis ich eine Nummer auswähle. –
@ JoãoGuerreiro überprüfen Sie die Antwort unten. –