"image switch"
Bootstrap 3.3.0 Snippet by escapedlion

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row"> <div class="col-sm-4"> <div class="panel panel-primary"> <div class="panel-body"> <div class="form-group"> <label class="col-sm-3 control-label" for="logoFileImage">Image File</label> <div class="col-sm-9"> <div class="thumbnail"> <img src="http://lorempixel.com/400/200/sports/1" /> </div> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label" for="logoFileName">Image File Name</label> <div class="col-sm-9"> <select id="picDD"> <option value="http://lorempixel.com/400/200/sports/1">Picute 1</option> <option value="http://lorempixel.com/400/200/sports/2">Picute 2</option> <option value="http://lorempixel.com/400/200/sports/3">Picute 3</option> <option value="http://lorempixel.com/400/200/sports/4">Picute 4</option> <option value="http://lorempixel.com/400/200/sports/5">Picute 5</option> </select> </div> </div> </div> </div> </div> </div> </div> </div>
img {width:400px; margin:auto; }
$('#picDD').change(function () { var val = $(this).val() $('img').attr("src",val); });

Related: See More


Questions / Comments: