css - Radio Select with Image but Hide Radio Button and use image to select -
css - Radio Select with Image but Hide Radio Button and use image to select -
using opencart version 2.0.0
within product.tpl page there foreach alternative loop contains this
<?php if ($option['type'] == 'image') { ?> <div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>"> <label class="control-label"><?php echo $option['name']; ?></label> <div id="input-option<?php echo $option['product_option_id']; ?>"> <?php foreach ($option['product_option_value'] $option_value) { ?> <div class="radio"> <label> <input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" /> <img src="<?php echo $option_value['image']; ?>" alt="<?php echo $option_value['name'] . ($option_value['price'] ? ' ' . $option_value['price_prefix'] . $option_value['price'] : ''); ?>" class="img-thumbnail" /> <?php echo $option_value['name']; ?> <?php if ($option_value['price']) { ?> (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>) <?php } ?> </label> </div> <?php } ?> </div> </div> <?php } ?>
which fine , working. want know, is, see they've wrapped input in label class. because image select, can have little 50px image of colour, select option, , can click on image opposed clicking on radio button select it.
what want know is, using jsfiddle i've made http://jsfiddle.net/8fqqrstq/ want remove radio button using
input[type="radio"] { visability: hidden; }
but people still click on image select option. but!, whe alternative selected, :checked css used alter border of image
border: solid 1px #ff0000
how go doing this?
i don't have plenty reputation comment, having same problem , wanted post jsfiddle link show trying in case else bit confused on it!
the thing changed removed text next each alternative , gave each radio button same name 1 selected! used
display:none;
instead of
visibility: hidden;
for radio buttons space isn't taken up.
this css shows how utilize images options without showing radio button too.
div.radio img { border: solid 1px #bbb; padding: 2px; } div.radio label { font-family: arial; } input[type=radio]{ display: none; } input[type=radio]:checked + img { border: solid 1px #ff0000; }
css css3 twitter-bootstrap radio-button opencart
Comments
Post a Comment