liste
Posté : 10 juin 2019, 22:25
bonsoir
j'ai fait un code pour faire un chois entre couleur et motif
une fonction
le probleme que je rencontre c'est quand je selectionne couleur et que je choisis une couleur ma page prend bien la couleur mais je trouve un souci au niveau de chois image ma page ne prend pas l'image choisis je pense ca viens dans ma fonction est quelqun qui peux m’aidè merci
j'ai fait un code pour faire un chois entre couleur et motif
Code : Tout sélectionner
<div class="form-group col-md-4">
<select id="configuration_backgroundType" class="form-control"><option value="0">Couleur</option><option value="1" selected="selected">Motif</option></select>
</div>
<div class="row motif">
<div class="col-md-3">
<input type="radio" id="background_image" name="background_image" value="0" />
<img src="./img/background-0.jpg" class="background-choice">
</div>
<div class="col-md-3">
<input type="radio" id="background_image" name="background_image" value="1" />
<img src="./img/background-1.jpg" class="background-choice">
</div>
<div class="col-md-3">
<input type="radio" id="background_image" name="background_image" value="2" />
<img src="./img/background-2.jpg" class="background-choice">
</div>
<div class="col-md-3">
<input type="radio" id="background_image" name="background_image" value="3" />
<img src="./img/background-3.jpg" class="background-choice">
</div>
</div>
Code : Tout sélectionner
setBackgroundColor: function () {
if (prayer.confData.backgroundType === 'couleur') {
$("body").css("backgroundColor", prayer.confData.backgroundColor);
}
if (prayer.confData.backgroundType === 'motif') {
$("body").css("backgroundImage", 'url("./img/background-' + prayer.confData.background_image)');
}
},