i have a bootstrap toggle button for map using checkbox. when i want to click on that toggle switch then map div will be show. And when we turn it to off(or is UNCHECKED) then my scroll bar card section will be expand and map will be hidden. here i share you code.
MAP TOOGLE SWITCH CODE
- <div id="maptoggle">
- <div class="col-sm-4 mt-3 ">
- <text class="map">MAP VIEW</text> <span>
- <div class="custom-control custom-switch">
- <input type="checkbox" class="custom-control-input" value="check"
- id="customSwitches" checked>
- <label class="custom-control-label" for="customSwitches"></label>
- </div>
- </span>
- </div>
- </div>
CARD SECTION
MAP
- <div class="col-sm-7 col-md-7 map-card" id="spire-map">
- <div class="row map-image mt-3">
- <!-- <img src="..\bootstrap_navbar\assets\images\map-image.png" alt="map-image"
- class="img img-responsive" style="width: 100%;"> -->
- <iframe
- src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3782.2470145766283!2d73.79360031489337!3d18.56289918738437!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3bc2bf29c4263285%3A0x2d7a07fc0d5074bc!2sThe%20Spires!5e0!3m2!1sen!2sin!4v1588847570414!5m2!1sen!2sin"
- width="600" height="450" frameborder="0" style="border:0;" allowfullscreen=""
- aria-hidden="false" tabindex="0"></iframe>
- </div>
- </div>
HERE IS SOME JQUERY CODE I HAVE CREATED
- <script>
- $(document).ready(function () {
- $('#card').click(function () {
- $('#maxcard-hide').show();
- $('#spire-map').hide();
- });
- $('#cross').click(function () {
- $('#maxcard-hide').hide();
- $('#spire-map').show();
- });
-
- $(function () {
- $('#customSwitches').change(function () {
- if ($('#customSwitches').is(':checked'))
- $("#spire-map").fadeOut();
- else
- $('#all-card').fadeIn();
- });
- });
- });
- </script>
PLEASE suggest me how will expand that all card section there are totatl 12 cards in scrollbr when we unchecked it the scrollbar section will be expand and result will be that 12 cards will be divided into two column 6 card in each column