Showing posts with label twitter-bootstrap-3. Show all posts
Showing posts with label twitter-bootstrap-3. Show all posts

Sunday, September 2, 2018

How to stop boostrap modal video autoplays on page refresh

Leave a Comment

I am working with bootstrap modal here this code is working fine when I use URL. But when I'm trying to play the video from my local directory. Example when i use <iframe width="1280" height="720" id="sampleVideo" src="assets/sample.mp4" frameborder="0" allowfullscreen></iframe> its not working fine.The issue is whenever page refresh video automatically plays before click on play video button. I tried using HTML5 video tag also but the problem is with the bootstrap model that is not working. And also ?rel=0. I don't want to use any plugins.

$(document).ready(function() {    $(".modal").modal('hide');    var url = $("#sampleVideo").attr('src');      $(".modal").on('hide.bs.modal', function() {      $("#sampleVideo").attr('src', '');    });      $(".modal").on('show.bs.modal', function() {      $("#sampleVideo").attr('src', url);    });  });
.teaser {    background-size: cover;    position: relative;  }    .teaser .modal-dialog {    max-width: 100%;  }    .teaser .modal {    padding-right: 0!important;  }    .teaser iframe {    height: 100vh;    width: 100%;  }    .teaser .modal-body {    padding: 0;    margin: 0;  }    .teaser .close {    color: white;    position: absolute;    /* background: blue !important; */    border: 0;    top: 0;    z-index: 99999;    right: 3%;    float: none;    opacity: 1;    font-size: 40px;    font-weight: 400;  }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>  <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />    <div class="teaser container-fluid">    <a href="#videoStory" class="videoBtnbutton more mt-4 d-block" role="button" data-toggle="modal" data-target="#modal-fullscreen">Play Video</a>    <div class="modal modal-fullscreen fade" id="modal-fullscreen" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">      <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>      <div class="modal-dialog">        <div class="modal-content">          <div class="modal-body" id="yt-player">            <iframe width="1280" height="720" id="sampleVideo" src="https://www.youtube.com/embed/ScMzIvxBSi4" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>          </div>        </div>      </div>    </div>  </div>

the working code here codepen link here

1 Answers

Answers 1

Because that if you use iframe to insert a local video, browser like Chrome will create elements like:

<video controls autoplay name="media">     <source src="assets/sample.mp4" type="video/mp4"> </video> 

It will add attribute autoplay.

So one way you can handle it is that removing autoplay attribute from the element on document ready:

$(document).ready(function(){     $("#sampleVideo").contents().find('video').prop("autoplay", false); }); 

But you will probably meet an issue that video plays before document ready. A way to mitigate it is to reset video progress:

$(document).ready(function(){     var elem = $("#sampleVideo").contents().find('video')[0];     elem.autoplay = false;     elem.pause();     elem.currentTime = 0; }); 

For re-opening the modal, you can also add event handler for iframe onload:

$('#sampleVideo').on('load', function() {     var elem = $("#sampleVideo").contents().find('video')[0];     elem.autoplay = false;     elem.pause();     elem.currentTime = 0; }); 

But I think the real way to deal with it is to use real video tag for local resources:

<div class="modal-body" id="yt-player">     <video controls name="media">         <source src="assets/sample.mp4" type="video/mp4">     </video> </div>  $(document).ready(function(){     $(".modal").modal('hide');     var url = $("#sampleVideo").attr('src');      $(".modal").on('hide.bs.modal', function(){         var elem = $("#sampleVideo")[0];         elem.pause();         elem.currentTime = 0;     });      $(".modal").on('show.bs.modal', function(){         var elem = $("#sampleVideo")[0];         elem.pause();         elem.currentTime = 0;     }); }); 

Because url in src of the iframe should return an HTML.

Read More

Thursday, August 16, 2018

Ie11 data-toggle not disabling

Leave a Comment

So I have an interesting bug that my brain can't figure out.

In the app I am working on there are several bootstrap toggle buttons that have the ability to be disabled. However, it seems in internet exploder the disabled="disabled" property is not being adhered to.

The red x appears over the button and it is greyed out, but when clicked it still changes the state.

An example of the code in a jsbin https://jsbin.com/koqapejome/1/edit?html,css,output

My html buttons look like this. Notice I am taking advantage of bootstrap 3's data-toggle

<div class="btn-group toggle" data-toggle="buttons-radio">   <button disabled="disabled" type="button" data-label="Something here" data-type="CHECKBOX" data-name="name" name="name" id="form_154_emailList" class="btn yes active">Yes</button>   <button disabled="disabled" type="button" class="btn no">No</button> </div> 

Is there a reason why the disabled is not fully working in ie? Is this a known issue? I could only find vague posts about switching it to disabled="true" which did not work either.

Through testing I can see an 'active' class being added when clicked, however when trying to add a click handler to disable the click it is not recognized when clicked. So it seems to be something else adding that...but I can't figure out what.

Does anyone know what could be causing this? Is it the bootstrap click that is ignoring the disable?

2 Answers

Answers 1

You can use this code to do not trigger in all browsers:

.toggle{    cursor:no-drop }  .btn:disabled{    pointer-events:none; } 

Answers 2

I think the problem is with your custom style. You can check out working version here.

The problem was with following styles in particular.

.btn-group.toggle .btn.yes.active .btn-group.toggle .btn.no.active 

They should have been:

.btn-group.toggle .btn.yes.active:enabled .btn-group.toggle .btn.no.active:enabled 

Or you can apply different style with following styles:

.btn-group.toggle .btn.yes.active:enabled .btn-group.toggle .btn.yes.active:disabled  .btn-group.toggle .btn.no.active:enabled .btn-group.toggle .btn.no.active:disabled 
Read More

Wednesday, January 24, 2018

Customizable jQuery datetimepicker plugin

Leave a Comment

I am finding a date time picker plugin which have feature scrolling left to right or right to left. It should be work on mobile screen also. I am sharing a picture what I want. I found a link which is so nearest from my query but in this plugin time picker is not showing.

Plugin Url http://www.bestjquery.com/?jGUMy1Ky

Suggest any other plugin or customizable plugin.

enter image description here

4 Answers

Answers 1

@NoobProgrammerI totally do agree with you & for that, I have made some change in that plugin & modified it. Here is the code. codepen.io/hardenrahul/pen/EoGmwd

Answers 2

A jQuery/Bootstrap 3 datetime picker plugin rich of features and highly customizable is eonasdan bootstrap-datetimepicker:

or its fork (and successor) Tempus Dominus available both for Bootstrap 3 and Bootstrap 4:

A jQuery-only plugin with several options is:

As suggest already by NoobProgrammer DateBox is a good mobile friendly option:

As completely mobile friendly alternative, but with separated date and time pickers is pickadate.js:


As a guideline to select a JS plugin I suggest, besides to view offered functionalitis, to check also:

  • github repo for number of contributions, "freshness" of code (latest commit), number of forks
  • number of posts here on stackoverflow

Answers 3

Try this one : DateBox

It's Something like this

Image References

Answers 4

Please check this out. It also has a lot of examples in this page so you can easily customize it for your needs.

http://trentrichardson.com/examples/timepicker/

Read More

Thursday, January 11, 2018

Overlap with a translucent div in a responsive website

Leave a Comment

I have been working on a self-project to duplicate the reddit page for javascript using the JSON data available. But am not able to replicate the behaviour of the original website in its header section, where the header is responsive (behaviour when screen size is decreased).

enter image description here

GIF : how the original website header section works.

The problem :

  1. Overlap the right side (Login page options) over the left hand side. The overlapping is such that the behind text is not shown. I have managed to do the overlapping, but since the background for the divs are translucent, the behind text too shows. Can't think of any solution for this.

GIF : my header (behind text seen)

  1. The navbar elements transcend down when space is not enough. This is not how it is in the original, where they get hidden by the more and Login section. I cannot figure out how to go about having it in a single row.

GIF : my header (header elements move down)


A smaller, similar sample snippet :

.custom-header-full{      background: rgba(255,255,0,1);  }    /* Top */  .custom-top-header-container{      background: rgba(0,0,0,0.7);       /* translucent */      position:absolute;      top:0;      width: 100%;  }  #top-right-div{      position: absolute;      right: 0;      z-index: 1000;  }
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"        rel="stylesheet"/>    <div class="navbar navbar-static-top custom-header-full">        <!-- TOPMOST header with Links and Login/Signup -->      <div class="navbar-header custom-top-header-container">          <!-- Left side with various links -->          <div id="top-left-div">              <a class="navbar-brand" href="#">MY SUBREDDITS ▼</a>              <a class="navbar-brand" href="#">POPULAR</a>              <a class="navbar-brand" href="#">ALL</a>              <a class="navbar-brand" href="#">RANDOM</a>          </div>            <!-- Login/Signup on the right -->          <div id="top-right-div">              <span class="navbar-brand">Want to join?                  <a href="#">Log in or sign up</a>                  in seconds |                  <button class="glyphicon glyphicon-wrench tools-icon"></button>              </span>          </div>        </div>  </div>

In case you want to check with the full project, the link on Github.

An interesting point to Note : in the header, the left sided titles are being overlapped by the right sided section. So it is a smooth transaction where the possibility is such that even partial of the text is seen in a title when overlapped. Basically its not a matter of making the title element invisible by width as that would make the whole title invisible.

Ex :

  • The title has TODAYIL enter image description here

  • The title has TODAYILEARNED (whole of the title) enter image description here

5 Answers

Answers 1

If you're able to use CSS flexbox, I think this solution works the way you want:

.custom-header-full{      background: rgba(255,255,0,1);  }    /* Top */  .custom-top-header-container{      background: rgba(0,0,0,0.7);       /* translucent */      position:absolute;      top:0;      width: 100%;      display: flex;  }  #top-left-div {      flex: 1 1 0%;      overflow: hidden;      display: flex;      white-space: nowrap;  }  #top-right-div{      flex: 0 0 auto;  }
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"        rel="stylesheet"/>    <div class="navbar navbar-static-top custom-header-full">        <!-- TOPMOST header with Links and Login/Signup -->      <div class="navbar-header custom-top-header-container">          <!-- Left side with various links -->          <div id="top-left-div">              <a class="navbar-brand" href="#">MY SUBREDDITS ▼</a>              <a class="navbar-brand" href="#">POPULAR</a>              <a class="navbar-brand" href="#">ALL</a>              <a class="navbar-brand" href="#">RANDOM</a>          </div>            <!-- Login/Signup on the right -->          <div id="top-right-div">              <span class="navbar-brand">Want to join?                  <a href="#">Log in or sign up</a>                  in seconds |                  <button class="glyphicon glyphicon-wrench tools-icon"></button>              </span>          </div>        </div>  </div>

What I did:

  1. Make .custom-top-header-container display:flex to ensure the left and right display side-by-side.
  2. Make #top-right-div only ever take up the space that its content needs (i.e. don't grow or shrink)
  3. Make #top-left-div fill whatever space remains in the container, and use overflow:hidden to hide any content that might overlap with #top-right-div on small widths.
  4. Set #top-left-div to white-space: nowrap to prevent links with spaces (like "My Subreddits") from breaking onto multiple lines when the screen shrinks small enough.

Answers 2

I've managed to implement a pure-CSS solution without flex of what I assume you wanted to get.

I will highlight some of the changes I've made (the ones that don't directly pertain to the problem and could therefore be overlooked):

  • Got rid of .navbar, .navbar-static-top, .navbar-header, .custom-header-full and .custom-top-header-container. Please find a way to overwrite their behaviour at your own time if you really need those classes. I can try to help if it proves too difficult.
  • Removed CAPS LOCK from source and substituted it with text-transform: uppercase; inside the CSS file. This can really help in the future if one happens to fall asleep while adding a new navigation link.
  • Substituted "▼" with an HTML entity (&#9660;). Modern browsers normally don't care, but it's still good practice.

Here is a Fiddle of the end result. Let me know if you have any questions.

Answers 3

A little hack can help you I guess. Try doing these CSS changes :

#top-right-div {     position: absolute;     right: 0px;     z-index: 1000;     background: rgba(255,255,0,1); } 

And add background: rgba(0, 0, 0, 0.7); to the .navbar-brand under top-right-div in html.

This would create an illusion of what you are trying to achieve.

.custom-header-full{      background: rgba(255,255,0,1);  }    /* Top */  .custom-top-header-container{      background: rgba(0,0,0,0.7);       /* translucent */      position:absolute;      top:0;      width: 100%;      display: flex;  }  #top-left-div {      flex: 1 1 0%;      overflow: hidden;      display: flex;      white-space: nowrap;  }  #top-right-div{      flex: 0 0 auto;      background: rgba(255,255,0,1);  }
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"        rel="stylesheet"/>    <div class="navbar navbar-static-top custom-header-full">        <!-- TOPMOST header with Links and Login/Signup -->      <div class="navbar-header custom-top-header-container">          <!-- Left side with various links -->          <div id="top-left-div">              <a class="navbar-brand" href="#">MY SUBREDDITS ▼</a>              <a class="navbar-brand" href="#">POPULAR</a>              <a class="navbar-brand" href="#">ALL</a>              <a class="navbar-brand" href="#">RANDOM</a>          </div>            <!-- Login/Signup on the right -->          <div id="top-right-div">              <span class="navbar-brand" style="background: rgba(0, 0, 0, 0.7);">Want to join?                  <a href="#">Log in or sign up</a>                  in seconds |                  <button class="glyphicon glyphicon-wrench tools-icon"></button>              </span>          </div>        </div>  </div>

Answers 4

for Overlap you can use this style:

.custom-header-full{     background: rgba(255,255,0,1); }  /* Top */ .custom-top-header-container{     background: rgba(0,0,0,0.7);      position:absolute;     top:0;     width: 100%; } #top-right-div {     width: 45%;     float: left; }  #top-left-div {     display: inline-block;     width: 53%;     float: left; } 

Like :demo

and other device you can use media queries Like :

 @media (min-width:0px) and (max-width:799px) { add style  } 

write style according to device.

i thing it's helpful for you.

Answers 5

To handle the stretching issues. Try to inspect the website using responsive option

responsive button

Then you can know the dimension of the screen when the texts are overlapping or the navigation bar is two line high

get the width

So at last you can add your media query to create differences from the desktop website. In case it's 450px

@media only screen and (max-width: 450px) {     /* Add your css specification here. */ } 
Read More

Sunday, October 1, 2017

How can I keep a row of a button and text from wrapping using multicol?

Leave a Comment

I have a series of rows consisting of a button and text, like so:

[Button] [Text] [Button] [Text] [Button] [Text] ... 

When I apply the multicol class, they eventually wrap around, like so:

[Button] [Text]   [Button] [Text] [Button] [Text]   .... 

Unfortunately, in many cases, the button or the text gets broken in half when going into the next column. Using "display: inline-block" makes my buttons and text vary in size on different screen resolutions, and makes them spaced strangely.

What is the best way to keep the [Button] [Text] combination from breaking in the column, while keeping each [Button] [Text] combination equally spaced, and looking the same?

.multicol {    column-count:2;    -moz-column-count:2;    -webkit-column-count:2;  }
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">    <!-- Imagine 20-25 of these in a row -->    <div class='multicol'>       <div class='row'>           <div class='col-xs-5'>                <button class='btn btn-block' style='min-width: 100px;'>  (VARYING-LENGTH BUTTON NAMES HERE) </button>            </div>            <div class='col-xs-7'>                 <p> (VARYING-LENGTH DESCRIPTIONS HERE) </p>             </div>        </div>    </div>

1 Answers

Answers 1

First of all, added white-space: normal to the button to override the default nowrap from bootstrap's btn class.

Unfortunately, in many cases, the button or the text gets broken in half when going into the next column. Using "display: inline-block" makes my buttons and text vary in size on different screen resolutions, and makes them spaced strangely.

Well, you can avoid the breaking to the next column by using:

-webkit-column-break-inside: avoid; /* Chrome, Safari, Opera */ page-break-inside: avoid; /* Firefox */ break-inside: avoid; /* IE 10+ */ 

and makes them spaced strangely

Add column-gap: 0 to remove the default column gaps.

.multicol {    column-count: 2;    -moz-column-count: 2;    -webkit-column-count: 2;    column-gap: 0;  }    .multicol button {    white-space: normal;  }    .multicol>.row {    -webkit-column-break-inside: avoid; /* Chrome, Safari, Opera */    page-break-inside: avoid; /* Firefox */    break-inside: avoid; /* IE 10+ */  }    /*for illustration*/  .multicol>.row>* {    border: 1px solid;  }
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">  <!-- Imagine 20-25 of these in a row -->  <div class='multicol'>    <div class='row'>      <div class='col-xs-5'>        <button class='btn btn-block' style='min-width: 100px;'>  (VARYING-LENGTH BUTTON NAMES HERE) </button>      </div>      <div class='col-xs-7'>        <p> (VARYING-LENGTH DESCRIPTIONS HERE) </p>      </div>    </div>    <div class='row'>      <div class='col-xs-5'>        <button class='btn btn-block' style='min-width: 100px;'>  (VARYING-LENGTH BUTTON NAMES HERE) </button>      </div>      <div class='col-xs-7'>        <p> (VARYING-LENGTH DESCRIPTIONS HERE) </p>      </div>    </div>    <div class='row'>      <div class='col-xs-5'>        <button class='btn btn-block' style='min-width: 100px;'>  (VARYING-LENGTH BUTTON NAMES HERE) </button>      </div>      <div class='col-xs-7'>        <p> (VARYING-LENGTH DESCRIPTIONS HERE) </p>      </div>    </div>    <div class='row'>      <div class='col-xs-5'>        <button class='btn btn-block' style='min-width: 100px;'>  (VARYING-LENGTH BUTTON NAMES HERE) </button>      </div>      <div class='col-xs-7'>        <p> (VARYING-LENGTH DESCRIPTIONS HERE) </p>      </div>    </div>    <div class='row'>      <div class='col-xs-5'>        <button class='btn btn-block' style='min-width: 100px;'>  (VARYING-LENGTH BUTTON NAMES HERE) </button>      </div>      <div class='col-xs-7'>        <p> (VARYING-LENGTH DESCRIPTIONS HERE) </p>      </div>    </div>  </div>

Now you can add in some flexboxes here to suit your case - see demo below:

.multicol {    column-count: 2;    -moz-column-count: 2;    -webkit-column-count: 2;    column-gap: 0;  }    .multicol button {    white-space: normal;  }    .multicol>.row {    display: flex; /*NEW*/    margin: 0; /*NEW*/    -webkit-column-break-inside: avoid; /* Chrome, Safari, Opera */    page-break-inside: avoid; /* Firefox */    break-inside: avoid; /* IE 10+ */  }    .multicol p { /*NEW*/    height: 100%;  }    /*for illustration*/  .multicol>.row>* {    border: 1px solid;  }
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">  <!-- Imagine 20-25 of these in a row -->  <div class='multicol'>    <div class='row'>      <div class='col-xs-5'>        <button class='btn btn-block' style='min-width: 100px;'>  (VARYING-LENGTH BUTTON NAMES HERE) </button>      </div>      <div class='col-xs-7'>        <p> (VARYING-LENGTH DESCRIPTIONS HERE) </p>      </div>    </div>    <div class='row'>      <div class='col-xs-5'>        <button class='btn btn-block' style='min-width: 100px;'>  (VARYING-LENGTH BUTTON NAMES HERE) </button>      </div>      <div class='col-xs-7'>        <p> (VARYING-LENGTH DESCRIPTIONS HERE) </p>      </div>    </div>    <div class='row'>      <div class='col-xs-5'>        <button class='btn btn-block' style='min-width: 100px;'>  (VARYING-LENGTH BUTTON NAMES HERE) </button>      </div>      <div class='col-xs-7'>        <p> (VARYING-LENGTH DESCRIPTIONS HERE) </p>      </div>    </div>    <div class='row'>      <div class='col-xs-5'>        <button class='btn btn-block' style='min-width: 100px;'>  (VARYING-LENGTH BUTTON NAMES HERE) </button>      </div>      <div class='col-xs-7'>        <p> (VARYING-LENGTH DESCRIPTIONS HERE) </p>      </div>    </div>    <div class='row'>      <div class='col-xs-5'>        <button class='btn btn-block' style='min-width: 100px;'>  (VARYING-LENGTH BUTTON NAMES HERE) </button>      </div>      <div class='col-xs-7'>        <p> (VARYING-LENGTH DESCRIPTIONS HERE) </p>      </div>    </div>  </div>

Read More

Sunday, May 7, 2017

How to display multiple date ranges between a date-range Jquery

Leave a Comment

Hi I have a date ranger picker on this I want to display all the date ranges which is defined for a particular date-range as this:

Suppose my date range is: 01/01/2017-01/07/2017 and I have an array all the dates which is defined between for above date-range in db.So the array is like:

$sub_dates = ['01/01/2017','02/01/2017',.......till 01/07/2017];

So if I click on date range on date-range picker I need to show all these defined dates ($sub_dates ) on it.

var sub_dates = ['01/01/2017','02/01/2017',.......till 01/07/2017];   $('.lot-calander1').daterangepicker({     beforeShowDay: function(date){     var string = $.daterangepicker.formatDate('yy-mm-dd', date);     return [ sub_dates.indexOf(string) == -1 ]  }   });  

But it is not displaying these date on date-range picker. please assist what could be the issue

Thanks advance

3 Answers

Answers 1

$(function() {    var sub_dates = ['01/01/2017','01/03/2017','01/25/2017', '02/01/2017'];    var sub_dates_date = sub_dates.map(function(b) {      return +(new Date(b));    });      $('input[name="daterange"]').daterangepicker({      isInvalidDate: function(a) {        return sub_dates_date.indexOf(+(new Date(a))) < 0;      }    });  });
.daterangepicker td.available {  	color: red;  	background-color: blue;  }    .daterangepicker td.available.start-date, .daterangepicker td.available.end-date {  	color: green;  	background-color: black;  }
<!-- Include Required Prerequisites -->  <script type="text/javascript" src="//cdn.jsdelivr.net/jquery/1/jquery.min.js"></script>  <script type="text/javascript" src="//cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>  <link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/bootstrap/3/css/bootstrap.css" />     <!-- Include Date Range Picker -->  <script type="text/javascript" src="//cdn.jsdelivr.net/bootstrap.daterangepicker/2/daterangepicker.js"></script>  <link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/bootstrap.daterangepicker/2/daterangepicker.css" />  <input type="text" name="daterange" value="01/01/2017 - 01/31/2017" />

Please Note: You can change the color as you want.

Hope It will help you.

Answers 2

This solution uses 'invalidDate' to check against the array of dates and disable them. For simplicity and also comparison purpose we create a new array for the string of dates and make them integers. You can replace this method as necessary.

$(function() {    var sub_dates = ['01/01/2017','01/03/2017','01/25/2017', '02/01/2017'];    var sub_dates_date = sub_dates.map(function(b) {      return +(new Date(b));    });      $('input[name="daterange"]').daterangepicker({      isInvalidDate: function(a) {        return sub_dates_date.indexOf(+(new Date(a))) < 0;      }    });  });
<!-- Include Required Prerequisites -->  <script type="text/javascript" src="//cdn.jsdelivr.net/jquery/1/jquery.min.js"></script>  <script type="text/javascript" src="//cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>  <link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/bootstrap/3/css/bootstrap.css" />     <!-- Include Date Range Picker -->  <script type="text/javascript" src="//cdn.jsdelivr.net/bootstrap.daterangepicker/2/daterangepicker.js"></script>  <link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/bootstrap.daterangepicker/2/daterangepicker.css" />    <input type="text" name="daterange" value="01/01/2017 - 01/31/2017" />

Let us know.

Answers 3

You can use minDate and maxDate options

$(function() {    $('input[name="daterange"]').daterangepicker({        locale: {           format: 'MM/DD/YYYY'        },        minDate: '01/01/2017',        maxDate: '01/07/2017'    });  });
<!-- Include Required Prerequisites -->  <script type="text/javascript" src="//cdn.jsdelivr.net/jquery/1/jquery.min.js"></script>  <script type="text/javascript" src="//cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>  <link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/bootstrap/3/css/bootstrap.css" />     <!-- Include Date Range Picker -->  <script type="text/javascript" src="//cdn.jsdelivr.net/bootstrap.daterangepicker/2/daterangepicker.js"></script>  <link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/bootstrap.daterangepicker/2/daterangepicker.css" />    <input type="text" name="daterange" value="01/01/2017 - 01/07/2017" />

Read More

Monday, April 24, 2017

Using Bootstrap carousel to only show 8 items on each slide

Leave a Comment

I am generating an array of indeterminable number objects (since the array is created dynamically and based on an admin interface and how many objects they have entered.) I'm trying to use the Bootstrap carousel to display only 8 objects on each slide and if there are more than 8, move the extras to the next slide until 16, then the next slide up to 24, and so on. I also want it to run if the user clicks forward or back (not to go through the slides automatically.)

The following is my code that is being run, including the variable idx which is the sequential object number in the array (zero based.)

HTML

            <div id="articles" class="articles"></div> 

JavaScript:

    $(document).ready(function(){         <% JSONObject jsonObject=(JSONObject)session.getAttribute("responseDetailsJson"); %>         var tileSetObjects = <%=jsonObject%>             $.each(tileSetObjects.HelpJSONArray, function(idx, obj){                 $('#articles').append('<article class="pdf-guide" id="article-'+idx+'"><a href="'+obj.LINKVALUE+'" class="link-wrapper"><div class="title-link">'+obj.TITLE+'</div><p class="description">'+obj.LONGCONTENT+'</p></a></article>');             });         }); 

Thank you for the assistance!

3 Answers

Answers 1

You say you are using Bootstrap, but your markup does not reflect that at all.

I would start with the Bootstrap JavaScript Documentation which includes a detailed section on Carousel.

As it describes, set the interval option to 'false' to disable the auto scroll which will achieve your desired behavior. As described in the documentation:

The amount of time to delay between automatically cycling an item. If false, carousel will not automatically cycle.

Regarding the 8 at a time, your JavaScript looks like it should work, though the markup injection part will need to be modified to match the Bootstrap carousel markup (see above link).

Answers 2

I am not sure if this is possible with the Bootstrap carousel. But there are sliders that can fulfill your requirement. "Slick" slider is a plugin that matches your requirement and it's responsive too.

You can find the demo here: http://kenwheeler.github.io/slick/ and search for "Multiple Items".

Answers 3

number of object is depend on the width you assign to the BootStrap Carousel and depend on the width of each slides.

enter code here http://jsfiddle.net/asimshahiddIT/f1a1zbh4/1/

Read More

Sunday, April 16, 2017

JQUERY.COUNTO.JS: On Scroll Count Numbers NOT OnLoad

Leave a Comment

I'm working with one page website and I want to add a counting numbers with it, so I use javascript.countTo.js. I created every section to group related data and I put the section counter <section id="counters"> below my portfolio section <section class="justaddheight portfolio">. Everytime the page load the number count and when I scroll I always see that numbers stop or ended it's counting. Now, I want the number counts when I scroll and get into the section counter <section id="counters">. In addition, I used WOW.js and easingJS with my site, it's the best if you combined the code with it, but it also acceptable if not. The code are the following below:

index.html

<!DOCTYPE html> <html lang="en">     <head>         <meta charset="utf-8">         <title></title>         <meta http-equiv="X-UA-Compatible" content="IE=Edge">         <meta name="viewport" content="width=device-width, initial-scale=1"><!--The Viewport-->         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <!--Character Set-->         <meta http-equiv="Cache-control" content="no-cache"> <!--The No-Cache-->          <!--///////////////////////////////////////////////////////                             CSS          ///////////////////////////////////////////////////////-->         <link rel="stylesheet" href="css/animate.min.css">         <!-- Bootstrap -->         <link rel="stylesheet" href="css/bootstrap.min.css">         <!-- Font-Awesome -->         <link rel="stylesheet" href="css/font-awesome.min.css">         <!-- Icomoon-->         <link rel="stylesheet" href="css/icomoon.css">         <!-- Simple Line Icons -->         <link rel="stylesheet" href="css/simple-line-icons.css">              <!-- Fonts -->         <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700' rel='stylesheet' type='text/css'>           <!--///////////////////////////////////////////////////////                             JAVASCRIPT          ///////////////////////////////////////////////////////-->          <!-- jQuery -->         <script src="js/jquery.js"></script>         <!-- Bootstrap -->         <script src="js/bootstrap.min.js"></script>         <!-- Wow -->         <script src="js/wow.min.js"></script>         <!-- Counter -->         <script src="js/jquery.countTo.js"></script>         <!--Easing-->         <script src="js/jquery.easing.1.3.js"></script>                 <!--Custom JS-->         <script src="js/custom.js"></script>     </head>     <body id="top">         <section class="justaddheight text-center about" >             <h1>SCROLL DOWN</h1>             <p>First, Scroll Now</p>             <p>Second, try Again but wait for few seconds before scroll to identify.</p>         </section>          <section class="justaddheight service">          </section>          <section class="justaddheight portfolio">          </section>         <section id="counters">             <div class="ace-overlay"></div>             <div class="container">                 <div class="row">                     <div class="col-md-3 col-sm-6 col-xs-12">                         <div class="ace-counter to-animate">                             <i class="ace-counter-icon icon-briefcase to-animate-2"></i>                             <span class="ace-counter-number js-counter" data-from="0" data-to="89" data-speed="5000" data-refresh-interval="50">89</span>                             <span class="ace-counter-label">Finished projects</span>                         </div>                     </div>                     <div class="col-md-3 col-sm-6 col-xs-12">                         <div class="ace-counter to-animate">                             <i class="ace-counter-icon icon-code to-animate-2"></i>                             <span class="ace-counter-number js-counter" data-from="0" data-to="2343409" data-speed="5000" data-refresh-interval="50">2343409</span>                             <span class="ace-counter-label">Templates</span>                         </div>                     </div>                     <div class="col-md-3 col-sm-6 col-xs-12">                         <div class="ace-counter to-animate">                             <i class="ace-counter-icon icon-cup to-animate-2"></i>                             <span class="ace-counter-number js-counter" data-from="0" data-to="1302" data-speed="5000" data-refresh-interval="50">1302</span>                             <span class="ace-counter-label">Cup of coffees</span>                         </div>                     </div>                     <div class="col-md-3 col-sm-6 col-xs-12">                         <div class="ace-counter to-animate">                             <i class="ace-counter-icon icon-people to-animate-2"></i>                             <span class="ace-counter-number js-counter" data-from="0" data-to="52" data-speed="5000" data-refresh-interval="50">52</span>                             <span class="ace-counter-label">Happy clients</span>                         </div>                     </div>                 </div>             </div>         </section>     </body> </html>  <style type="text/css">     /* USE JUST TO ADJUST HEIGHT*/     .justaddheight{         height: 500px;     }     .text-center{         text-align: center;     } </style> <script type="text/javascript">     $('.counter-number').countTo(); </script> 

2 Answers

Answers 1

To check if the element is scrolled into view, I'll use function from this answer.

Now, we can check if the element #counters is in view by using below function

function isScrolledIntoView(el) {     var elemTop = el.getBoundingClientRect().top;     var elemBottom = el.getBoundingClientRect().bottom;      var isVisible = (elemTop >= 0) && (elemBottom <= window.innerHeight);     return isVisible; } 

This first gets the bounding points using getBoundingClientRect(). This returns top, left, bottom, right, width and height of the element on which the method is called. These can be used to detect if element is inside view. top and bottom are taken from this object and checked if element bottom is less than window height.


First of all, bind scroll event on the window. Inside the handler, check if element is in the view. When element comes in the view, then call the plugin on elements and unbind the scroll event.

function isScrolledIntoView(el) {    var elemTop = el.getBoundingClientRect().top;    var elemBottom = el.getBoundingClientRect().bottom;      var isVisible = (elemTop >= 0) && (elemBottom <= window.innerHeight);    return isVisible;  }    $(window).on('scroll', function() {    if (isScrolledIntoView(document.getElementById('counters'))) {      $('.ace-counter-number').countTo();        // Unbind scroll event      $(window).off('scroll');    }  });
.justaddheight {    height: 500px;  }    .text-center {    text-align: center;  }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-countto/1.2.0/jquery.countTo.js"></script>    <section class="justaddheight text-center about">    <h1>SCROLL DOWN</h1>    <p>First, Scroll Now</p>    <p>Second, try Again but wait for few seconds before scroll to identify.</p>  </section>  <section class="justaddheight service">    </section>  <section class="justaddheight portfolio">    </section>  <section id="counters">    <div class="ace-overlay"></div>    <div class="container">      <div class="row">        <div class="col-md-3 col-sm-6 col-xs-12">          <div class="ace-counter to-animate">            <i class="ace-counter-icon icon-briefcase to-animate-2"></i>            <span class="ace-counter-number js-counter" data-from="0" data-to="89" data-speed="5000" data-refresh-interval="100">89</span>            <span class="ace-counter-label">Finished projects</span>          </div>        </div>        <div class="col-md-3 col-sm-6 col-xs-12">          <div class="ace-counter to-animate">            <i class="ace-counter-icon icon-code to-animate-2"></i>            <span class="ace-counter-number js-counter" data-from="0" data-to="2343409" data-speed="5000" data-refresh-interval="50">2343409</span>            <span class="ace-counter-label">Templates</span>          </div>        </div>        <div class="col-md-3 col-sm-6 col-xs-12">          <div class="ace-counter to-animate">            <i class="ace-counter-icon icon-cup to-animate-2"></i>            <span class="ace-counter-number js-counter" data-from="0" data-to="1302" data-speed="5000" data-refresh-interval="50">1302</span>            <span class="ace-counter-label">Cup of coffees</span>          </div>        </div>        <div class="col-md-3 col-sm-6 col-xs-12">          <div class="ace-counter to-animate">            <i class="ace-counter-icon icon-people to-animate-2"></i>            <span class="ace-counter-number js-counter" data-from="0" data-to="52" data-speed="5000" data-refresh-interval="50">52</span>            <span class="ace-counter-label">Happy clients</span>          </div>        </div>      </div>    </div>  </section>

JsFiddle Demo

Answers 2

You can use appear.js plugin which provides event triggers for elements when they appear, disappear and reappear in the viewport.

<span class='count'>50</span> 

And the JS

appear({   init: function init() {},   elements: function elements() {     // Track all elements with the class "count"     return document.getElementsByClassName('count');   },   appear: function appear(el) {     $(el).countTo({       from: 0,       to: $(el).html(),       speed: 1300,       refreshInterval: 60     });   },   disappear: function disappear(el) {},   bounds: 200,   reappear: true }); 
Read More

Saturday, April 15, 2017

How to handle special Bootstrap events in React?

Leave a Comment

In straight up jQuery, I can do something like

$('#myCollapsible').on('click', 'hidden.bs.collapse', function () {   // do something… }) 

but is there a "right" way to do it in React? If the above is the way to go, where should I place that event handler? Please note that I am not using the react-bootstrap plugin.

1 Answers

Answers 1

The right way to handle events not directly supported by React is by adding an event listener to the DOM node after the component mounts, and removing it when the component unmounts:

class MyCollapsible extends React.Component {    constructor() {      super()      // Bind the method in the constructor instead of binding it in render, so you only do it once      this.handleHiddenBsCollapse = this.handleHiddenBsCollapse.bind(this)    }      componentDidMount() {      this.myCollapsible.addEventListener('hidden.bs.collapse', this.handleHiddenBsCollapse)    }      componentWillUnmount() {      this.myCollapsible.removeEventListener('hidden.bs.collapse', this.handleHiddenBsCollapse)    }      handleHiddenBsCollapse(event) {      // Do something...    }      render() {      // Settings refs with node => this.bla = node is recommended      // because this.refs is deprecated.      // in this example "node" is the DOM node itself, not a react reference      return (        <div ref={node => (this.myCollapsible = node)} />      )    }  }

Documentation for using DOM refs: https://facebook.github.io/react/docs/refs-and-the-dom.html

Read More

Wednesday, March 15, 2017

Bootstrap input-group-addon alignment issue when a span is added for required asterisks

Leave a Comment

I have following bootstrap datepicker. When I added a span (“spanAstreisk”) to display an asterisk indicating a required field, the height of icons is increased and it no longer looks like aligned with the textbox. How to fix this?

Fiddle2: https://jsfiddle.net/ezvzvvqg/15/

Fiddle1: https://jsfiddle.net/ezvzvvqg/10/

enter image description here enter image description here

HTML

 <table class="table table-user-information" style="font-size:12px;">                         <tbody>                              <tr>                                 <td class="tdPopupTextDescription">Effective Date:</td>                                 <td id="tdEffectiveDate">                                               <div id="divDatePickerEffectiveDate" class="input-group date" data-provide="datepicker" data-date-show-on-focus="true">                                         <input type="text" class="form-control required error" id="txtEffectiveDate" maxlength="10" style="display:inline;"><label for="txtEffectiveDate" generated="true" class="error">This field is required.</label>                                         <div class="input-group-addon">                                             <span class="glyphicon glyphicon-th"></span>                                         </div>                                         <span class="glyphicon glyphicon-asterisk requiredAsterisk"></span>                                     </div>                                   </td>                             </tr>                         </tbody>                     </table> 

8 Answers

Answers 1

Here's the new code

<table>     <tr>         <td class="tdPopupTextDescription">Effective Date:         </td>         <td id="tdEffectiveDate">             <div class="input-group date" data-provide="datepicker" data-date-show-on-focus="true">                 <input type="text" class="form-control required" id="txtEffectiveDate" maxlength="10" style="display:inline;">                 <div class="input-group-addon">                     <span class="glyphicon glyphicon-th"></span>                 </div>                 <div class="input-group-addon">                     <span id="test" class="glyphicon glyphicon-asterisk requiredAsterisk"></span>                 </div>                 <div class="input-group-addon spanAstreisk">                     <span id="spanAstreisk" class="glyphicon glyphicon-asterisk requiredAsterisk"></span>                 </div>             </div>         </td>     </tr> </table> 

CSS

.spanAstreisk{     background:none;     border:0 } 

Look at this solution: jsfiddle.net/SeniorFront/z24cc91a

Answers 2

Working example

<html>  <head>  <meta name="viewport" content="width=device-width, initial-scale=1">   <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">            <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>            <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>             <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">             <style type="text/css">                               </style>             </head>             <body>                          <table>   <tr>      <td class="tdPopupTextDescription">Effective Date:      </td>       <td id="tdEffectiveDate">        <div class="input-group date" data-provide="datepicker" data-date-show-on-focus="true">         <input type="text" class="form-control required" id="txtEffectiveDate" maxlength="" style="display:inline;">         <div class="input-group-addon">                 <span class="glyphicon glyphicon-th"></span>         </div>         <div class="input-group-addon">               <span id="test" class="glyphicon glyphicon-asterisk requiredAsterisk"></span>         </div>          <div class="input-group" style="height: 20px;">             <span id="spanAstreisk" class="glyphicon glyphicon-asterisk requiredAsterisk" style="position: absolute;top:10px;"></span>            </div>                 </div>            </td>     </tr>     </table>             </body>             </html>                 

If you need only one asterix you can achieve it like this

One asterix example

<html>  <head>  <meta name="viewport" content="width=device-width, initial-scale=1">   <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">            <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>            <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>             <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">             <style type="text/css">                               </style>             </head>             <body>                          <table>   <tr>      <td class="tdPopupTextDescription">Effective Date:      </td>       <td id="tdEffectiveDate">        <div class="input-group date" data-provide="datepicker" data-date-show-on-focus="true">         <input type="text" class="form-control required" id="txtEffectiveDate" maxlength="" style="display:inline;">         <div class="input-group-addon">                 <span class="glyphicon glyphicon-th"></span>         </div>                   <div class="input-group" style="height: 20px;">             <span id="spanAstreisk" class="glyphicon glyphicon-asterisk requiredAsterisk" style="position: absolute;top:10px;"></span>            </div>                 </div>            </td>     </tr>     </table>             </body>             </html>             

Hope this helps!

Answers 3

It looks like the problem is that you put a <label> inside the input-group but only input-group-addon, input-group-btn and form-control should be inside the input-group. That <label> is forcing the icons to stretch to accommodate the label. So I removed the <label> and put it outside the input-group. After I did that, the asterisk addon worked fine.

Here is a fiddle with my changes: https://jsfiddle.net/ezvzvvqg/18/

Here it is in Stack Snippet form:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>  <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.1/js/bootstrap-datepicker.js"></script>  <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>  <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.1/css/bootstrap-datepicker3.css" rel="stylesheet"/>  <table class="table table-user-information" style="font-size:12px;">      <tbody>                    <tr>              <td class="tdPopupTextDescription">Effective Date:</td>              <td id="tdEffectiveDate">                            <div id="divDatePickerEffectiveDate" class="input-group date" data-provide="datepicker" data-date-show-on-focus="true">                      <input type="text" class="form-control required error" id="txtEffectiveDate" maxlength="10" style="display:inline;">                      <div class="input-group-addon">                          <span class="glyphicon glyphicon-th"></span>                      </div>                      <span class="input-group-addon" id="sizing-addon1"><span id="spanAstreisk" class="glyphicon glyphicon-asterisk requiredAsterisk"></span></span>                  </div>                  <label for="txtEffectiveDate" generated="true" class="error">This field is required.</label>                </td>          </tr>      </tbody>  </table>

Update: I noticed that you had one other asterisk without input-group-addon. If you want the asterisk without the style of an input-group-addon, then you can use a span and then apply styles that will make it act like a input-group-addon. The style declarations that you need are: display:table-cell, vertical-align-middle (these two styles make the asterisk vertically-centered) and width:1% (to make it take the least amount of space). Plus padding:6px 12px to give it the same spacing as the addons. Here is a demo:

#spanAstreisk {    display:table-cell;    width:1%;    vertical-align:middle;    padding:6px 12px;  }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>  <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.1/js/bootstrap-datepicker.js"></script>  <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>  <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.1/css/bootstrap-datepicker3.css" rel="stylesheet"/>  <table class="table table-user-information" style="font-size:12px;">      <tbody>                    <tr>              <td class="tdPopupTextDescription">Effective Date:</td>              <td id="tdEffectiveDate">                            <div id="divDatePickerEffectiveDate" class="input-group date" data-provide="datepicker" data-date-show-on-focus="true">                      <input type="text" class="form-control required error" id="txtEffectiveDate" maxlength="10" style="display:inline;">                      <div class="input-group-addon">                          <span class="glyphicon glyphicon-th"></span>                      </div>                      <span id="spanAstreisk" class="glyphicon glyphicon-asterisk requiredAsterisk"></span>                  </div>                  <label for="txtEffectiveDate" generated="true" class="error">This field is required.</label>                </td>          </tr>      </tbody>  </table>

Answers 4

You just need a bit of positioning:

#spanAstreisk{     position: absolute;     top: 0; } 

Answers 5

I add some css, working with position and here is the result

https://jsfiddle.net/e1sue1ym/

`.input-group.date {   padding-right: 20px;   margin-bottom: 20px; } .input-group.date label.error {   position: absolute;   bottom: -23px;   left: 0; } .input-group .requiredAsterisk {   position: absolute;   right: 0px; }` 

Is that what do you want to achieve?

Answers 6

<table class="table table-user-information" style="font-size:12px;">     <tbody>          <tr>             <td class="tdPopupTextDescription">Effective Date:</td>             <td id="tdEffectiveDate">                           <div id="divDatePickerEffectiveDate" class="input-group date" data-provide="datepicker" data-date-show-on-focus="true">                     <input type="text" class="form-control required error" id="txtEffectiveDate" maxlength="10" style="display:inline;">                     <div class="input-group-addon">                         <span class="glyphicon glyphicon-th"></span>                     </div>                     <span class="input-group-addon" id="sizing-addon1"><span id="spanAstreisk" class="glyphicon glyphicon-asterisk requiredAsterisk"></span></span>                 </div>                 <label for="txtEffectiveDate" generated="true" class="error">This field is required.</label>              </td>         </tr>     </tbody> </table> 

And for your stylesheet

----- Stylesheet ----

#sizing-addon1{   background-color: transparent;   border:none;   font-size: 9px;   font-weight: normal;   padding:2px 5px;   color:#C00 } 

Answers 7

You have a lot of correct answers here so a different approach would be to put the asterisk inside the input field to indicate that the field is mandatory.

$("#txtEffectiveDate").on("focus",function(){  $( "#spanAstreisk" ).animate({      opacity: 1    },600);  $("#spanAstreisk").css("opacity",1);  }).on("blur",function(){  $( "#spanAstreisk" ).animate({      opacity: 0.25    },600);  });
#spanAstreisk {    position:absolute;    top:1rem;    right:4.5rem;    opacity:.25;    z-index:9999;    color:red;  }
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.1/css/bootstrap-datepicker3.css" rel="stylesheet"/>    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>  <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.1/js/bootstrap-datepicker.js"></script>    <table>   <tr>      <td class="tdPopupTextDescription">Effective Date:      </td>       <td id="tdEffectiveDate">        <div class="input-group date" data-provide="datepicker" data-date-show-on-focus="true">         <input type="text" class="form-control required" id="txtEffectiveDate" maxlength="10" style="display:inline;">         <span id="spanAstreisk" class="glyphicon glyphicon-asterisk requiredAsterisk"></span>         <div class="input-group-addon">                 <span class="glyphicon glyphicon-th"></span>         </div>              </div>     </td>     </tr>      </table>

Answers 8

One more way is to add the following style to the astrisk span:

#spanAstreisk {   display: table-cell;   vertical-align: middle; } 

Here is your updated fiddle: Fiddle

Read More

Friday, February 3, 2017

Bootstrap 3 .col-xs-offset-* doesn't work?

Leave a Comment

I am using bootstrap 3 grid system loved it so far and everything was working well, I am trying to use col-xs-offset-1 and doesn't work although .col-sm-offset-1 works. What am I missing here ?

<div class="col-xs-2 col-xs-offset-1">col</div> 

http://jsfiddle.net/petran/zMcs5/2/

13 Answers

Answers 1

Edit: as of Bootstrap 3.1 .col-xs-offset-* does exist, see bootstrap :: grid options


.col-xs-offset-* doesn't exist. Offset and column ordering are only for small and more. (ONLY .col-sm-offset-*, .col-md-offset-* and .col-lg-offset-*)

See the official documentation : bootstrap :: grid options

Answers 2

Alternatively, you can add an empty div for the xs-offset (would save you having to manage the content in more than one place)

<div class="col-xs-1 visible-xs"></div><div class="col-xs-2">col</div> 

The bootstrap devs seem to be refusing to add those xs- ofsets and push/pull classes, see here: https://github.com/twbs/bootstrap/issues/9689

Answers 3

You could get the offset set only for xs devises by negating the higher pixels with 0 offset. Like so,

class="col-xs-offset-1 col-md-offset-0" 

Answers 4

A suggestion for when you want to do an offset but find yourself incapable at extra small widths:

Use .hidden-xs and .visible-xs to make one version of your html block for extra small widths, and one for everything else (where you can still use an offset)

Example:

<div class="hero container">   <div class="row">     <div class="hidden-xs col-sm-8 col-sm-offset-2 col-md-4 col-md-offset-4 text-center">       <h2>This is a banner at the top of my site. It shows in everything except XS</h2>       <p>Here are some supporting details about my banner.</p>     </div>     <div class="visible-xs col-xs-12">       <h2 class="pull-right">This is my banner at XS width.</h2>       <p class="pull-right">This is my supporting content at XS width.</p>     </div>   </div> </div> 

Answers 5

This was really frustrating so I wrote a gist you can grab that enables col-offset-xs-*. I also noticed that Bootstrap SASS repo Bower installed this week did not include col-offset-sm-0 so that is shimmed too but will be redundant in many cases.

Bootstrap 3 xs offset shim

Answers 6

col-md-offset-4 does not work if you manually apply margin to the same element. For example

In the above code, offset will not be applied. Instead a margin of 0 auto will be applied

Answers 7

  /*    Include this after bootstrap.css    Add a class of 'col-xs-offset-*' and    if you want to disable the offset at a larger size add in 'col-*-offset-0'    Examples:   All display sizes (xs,sm,md,lg) have an offset of 1   <div class="col-xs-11 col-xs-offset-1 col-sm-3">    xs has an offset of 1   <div class="col-xs-11 col-xs-offset-1 col-sm-offset-0 col-sm-3">    xs and sm have an offset of 1   <div class="col-xs-11 col-xs-offset-1 col-md-offset-0 col-sm-3">    xs, sm and md will have an offset of 1   <div class="col-xs-11 col-xs-offset-1 col-lg-offset-0 col-sm-3">  */  .col-xs-offset-12 {     margin-left: 100%; } .col-xs-offset-11 {     margin-left: 91.66666666666666%; } .col-xs-offset-10 {     margin-left: 83.33333333333334%; } .col-xs-offset-9 {     margin-left: 75%; } .col-xs-offset-8 {     margin-left: 66.66666666666666%; } .col-xs-offset-7 {     margin-left: 58.333333333333336%; } .col-xs-offset-6 {     margin-left: 50%; } .col-xs-offset-5 {     margin-left: 41.66666666666667%; } .col-xs-offset-4 {     margin-left: 33.33333333333333%; } .col-xs-offset-3 {     margin-left: 25%; } .col-xs-offset-2 {     margin-left: 16.666666666666664%; } .col-xs-offset-1 {     margin-left: 8.333333333333332%; } .col-xs-offset-0 {     margin-left: 0; }  /* Ensure that all of the zero offsets are available - recent SASS version did not include .col-sm-offset-0 */ @media (min-width: 768px) {     .col-sm-offset-0,     .col-md-offset-0,     .col-lg-offset-0 {         margin-left: 0;     } } 

https://gist.github.com/dylanvalade/7362739

Answers 8

Its not working because col-xs-offset-* is mentioned out of the media query. if you want to use it, you have to mention all the offset (eg: class="col-xs-offset-3 col-sm-offset-2 col-md-offset-1 col-lg-offset-0")

But this is not right, they should mention col-xs-offset-* in the media query

Answers 9

// it works in bootstrap 4, there was some changes in documentation.We dont need prefix col-, just offset-lg-3 e.g.

<div class="row">    <div class="offset-lg-3 col-lg-6"> Some content...    </div> </div> 

// here doc: http://v4-alpha.getbootstrap.com/layout/grid/#example-offsetting-columns

Answers 10

The problem is that you're putting .name class instead of nameclass

Answers 11

instead of using col-md-offset-4 use instead offset-md-4, you no longer have to use col when you're offsetting. In your case use offset-xs-1 and this will work. make sure you've called the bootstrap.css folder into your html as follows .

Answers 12

As per the latest bootstrap v3.3.7 xs-offseting is allowed. See the documentation here bootstrap offseting. So you can use

<div class="col-xs-2 col-xs-offset-1">.col-xs-2 .col-xs-offset-1</div> 

Answers 13

Remove the dot in front of your class so it looks like this:

<div class="col-xs-2 col-xs-offset-1">col</div> 
Read More

Thursday, February 2, 2017

Webpack bootstrap-loader errors: Can't resolve './bootstrap-styles' and Can't resolve './bootstrap-scripts'

Leave a Comment

I'm trying to use bootstrap-loader in this angular 2 project. Webpack compilation outputs errors:

ERROR in ./~/bootstrap-webpack/index.js Module not found: Error: Can't resolve './bootstrap-styles' in 'd:\web\angular2-webpack-starter\node_modules\bootstrap-webpack'  @ ./~/bootstrap-webpack/index.js 1:0-66  @ ./src/vendor.browser.ts  @ multi vendor  ERROR in ./~/bootstrap-webpack/index.js Module not found: Error: Can't resolve './bootstrap-scripts' in 'd:\web\angular2-webpack-starter\node_modules\bootstrap-webpack'  @ ./~/bootstrap-webpack/index.js 2:0-52  @ ./src/vendor.browser.ts  @ multi vendor 

Steps to reproduce:

  1. clone https://github.com/AngularClass/angular2-webpack-starter
  2. npm install
  3. npm install bootstrap-webpack --save
  4. npm install less-loader less --save-dev
  5. add line: require("bootstrap-webpack"); to src/vendor.browser.ts
  6. add some rules to config/webpack.common.js from bootstrap-webpack documentation:
  7. npm start

Rules from bootstrap-webpack documentation:

// bootstrap-webpack has access to the jQuery object { test: /bootstrap\/js\//, loader: 'imports?jQuery=jquery' }, // Needed for the css-loader when [bootstrap-webpack](https://github.com/bline/bootstrap-webpack) // loads bootstrap's css. { test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,   loader: "url?limit=10000&mimetype=application/font-woff" }, { test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,    loader: "url?limit=10000&mimetype=application/octet-stream" }, { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,    loader: "file" }, { test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,    loader: "url?limit=10000&mimetype=image/svg+xml" } 

1 Answers

Answers 1

As I understood you just want to add bootstarp styles to your project, based on webpack.

The simple solution, which worked for me, was simply adding following to your styles/styles.scss:

@import url('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css');

Read More

Thursday, July 7, 2016

Use an image instead of a Bootstrap's glyphicon

Leave a Comment

I would like to use a custom image in an input-group instead of a Bootstrap glyphicon without padding bottom (my image touch the bottom of the button), as you can see on this picture:enter image description here


Actually, I use Bootstrap's glyphicon glyphicon-search:

<div class="input-group">       <input type="text" class="form-control" placeholder="Rechercher un produit, une référence ..."/>       <span class="input-group-addon">         <span aria-hidden="true" class="glyphicon glyphicon-search"></span>         <span class="hidden-xs text-upper-style">           Rechercher</span>       </span> </div> 

enter image description here

My issue is that I fail to replace glyphicon by my picture in my search bar.

I've tried to create CSS to mimic those of Bootstrap, but it always render bad:


CSS

.glyphi {     position: relative;     top: 1px;     display: inline-block;     font-style: normal;     font-weight: normal;     line-height: 1;     float: left;     display: block; } .glyphi.search {     background: url(../img/header/search.png);     background-size: cover;  } .glyphi.normal {      width: 28px; //But Bootstrap glyphicon is 16x16...     height: 16px; } 

HTML

<span aria-hidden="true" class="glyphicon glyphicon-search"></span> 

Note that my image is not square (60x37 px).

Here is the picture that should replace the glyphicon:

enter image description here

What is the best Bootstrap way to do that? Here is a Bootply of my code.

Thanks! :)

8 Answers

Answers 1

You can use simple img inside .input-group-addon instead of span.glyphicon and with some negative margins you can get the result you want.

HTML

<div class="input-group">    <input type="text" class="form-control" placeholder="Rechercher un produit, une référence ...">          <span class="input-group-addon">        <img src="http://i.stack.imgur.com/vr0uy.png">        <span class="hidden-xs text-upper-style">Rechercher</span>    </span>       </div> 

and CSS

.rechercheProduit .input-group-addon img{   height: 24px;   margin-right: -16px;   margin-bottom: -6px;   vertical-align:text-bottom; /* align the text */ } 

updated Bootply

Answers 2

You should have a look on how the glyphicon span works: If you inspect it, you will see that the interesting part in this span is actually its pseudo-element, the :before that calls a font of icons as a content.

Screenshot of the Glyphicon span behaviour in the DOM


A few solutions are actually possible to resolve your problem.

Override

  1. One of the solution would be to override that pseudo element by redeclaring its content:

    .rechercheProduit .input-group-addon {   /* Declaring the parent as relative so the .glyphicon-search child span       as a position absolute to its parent..       That probably doesn't make any sense. */   position: relative; } .rechercheProduit .glyphicon-search {   /* 'absolute' in the .input-group-addon context */   position: absolute;    top: auto;   bottom: 0;   left: 5px;   height: 80%;   width: auto;    overflow: hidden; }   .rechercheProduit .glyphicon-search:before {     content: '';     display: block;     width: 50px; /* Generic width */     height: 100%;     background: url('http://i.stack.imgur.com/vr0uy.png') no-repeat;     background-size: auto 100%;   } .rechercheProduit .text-upper-style {   /* relative to its context. Especially here to deal with the display order. */   position: relative;   margin-left: 20px; }  

    Demo 1


Custom span

  1. Another solution, which would probably be better, would be to actually create your own span with your own pseudo-element (CSS is similar to the last example, renaming the .glyphicon-search part obviously):

    <span class="input-group-addon">   <span class="search-icon"></span>   <span class="hidden-xs text-upper-style">   Rechercher</span> </span> 

    Demo 2


Image

  1. Even if I personally prefer having the icon as a background image here (have a look on this question and its answers), declaring the icon as an image is another solution that works.

    c.f. the answer of tmg about that.


About the rest

To go beyond with your code, you should think about the fact that you are working in a form with an input[type="text"] as main input.

You’ll have to submit this form and unless you deal with a click event on this main span to submit your form, you’ll have to declare your rechercher span as an input as well (type=“submit”).

That would be semantically more correct and easier for you to deal with this button action in the future.

My final proposition would then be: (also considering the "custom" span icon solution)

<div class="input-group">   <input type="text" class="form-control" placeholder="Rechercher un produit, une référence ...">   <label class="input-group-addon">     <span class="search-icon"></span>     <input type="submit" value="Rechercher" class="hidden-xs text-upper-style" />   </label> </div> 

-

.text-upper-style {   background: none;   text-transform: uppercase;   border: 0;   outline: 0; } .rechercheProduit .input-group-addon {   border: 0; } 

Demo 3

About the responsive, just declare a min-width on your label:

.rechercheProduit .input-group-addon {   min-width: 40px;   overflow: hidden; } 

Hope this makes sense. I'm open to any kind of suggestion, edit, etc...

Bon chance!

Answers 3

Here is the css that will replace the search icon

.glyphi {  background: rgba(0, 0, 0, 0) url("http://i.stack.imgur.com/vr0uy.png") no-repeat scroll 0 0 / contain;  display: inline-block;  font-style: normal;  font-weight: 400;  height: 16px;  line-height: 1;  position: relative;  top: 1px;  width: 60px;  } 

You also need to resize the search icon because the parent element has padding.

Answers 4

It's as easy as replace span glyphicon tag for your custom image tag forcing correct height and deleting top and bottom padding from text 'rechercher'.

So, add this to your html:

  <span class="input-group-addon">     <img height="25" src="http://i.stack.imgur.com/vr0uy.png" alt="custom-magnifier">     <span class="hidden-xs text-upper-style">       Rechercher</span>   </span> 

So, add this to your css:

.rechercheProduit .input-group-addon {   padding: 0 12px; } .rechercheProduit .input-group-addon {   vertical-align: bottom; } 

Here you have an example: http://www.bootply.com/CAPEgZTt3J

Answers 5

This is my attemp, i hope this one can help you. i use absolute. Just try to view in full page, i working the responsive design.

* {      border-radius: 0 !important;  }  .rechercheProduit .input-group-addon {    border: 0px;    color: #ffffff;    background: #004392;    cursor: pointer;  }  .rechercheProduit:hover {    color: #fbba00;  }  .rechercheProduit .form-control,  .rechercheProduit .input-group-addon {    border: solid 2px #004392;  }  .rechercheProduit .input-group-addon {    -moz-border-radius: 0;    -webkit-border-w: 0;    border-radius: 0;    color: #ffffff;    background: #004392;    cursor: pointer;  }  .rechercheProduit .input-group-addon:hover {    color: #fbba00;  }    .text-upper-style {    text-transform: uppercase;    padding-left: 20px;  }  .glyphicon-search:before {      background: url(http://i.stack.imgur.com/vr0uy.png)center center;      background-size: contain;      background-repeat: no-repeat;      height: 25px;      width: 42px;      content: '';      z-index: 99;      position: absolute;      top: -15px;      left: -8px;  }  .glyphicon-search:before{    content: '' !important;  }  @media screen and (max-width: 767px){    .cus-icon{      padding: 0 10px;    }      }
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>  <div class="col-xs-8 col-md-6">    <form class="form-horizontal rechercheProduit">      <div class="input-group">        <input type="text" class="form-control" placeholder="Rechercher un produit, une référence ...">        <span class="input-group-addon">          <span aria-hidden="true" class="glyphicon glyphicon-search cus-icon"></span>          <span class="hidden-xs text-upper-style">            Rechercher</span>        </span>      </div>    </form>  </div>

Answers 6

One way would be to use a background-image on the input-group-addon + some padding-left and remove the glyphicon entirely:

* {    border-radius: 0 !important;  }  .rechercheProduit .input-group-addon {    border: 0px;    color: #ffffff;    background: #004392;    cursor: pointer;  }  .rechercheProduit:hover {    color: #fbba00;  }  .rechercheProduit .form-control,  .rechercheProduit .input-group-addon {    border: solid 2px #004392;  }  .rechercheProduit .input-group-addon {    -moz-border-radius: 0;    -webkit-border-w: 0;    border-radius: 0;    color: #ffffff;    background: #004392;    cursor: pointer;    background-image: url("http://i.stack.imgur.com/vr0uy.png");    background-position: 6px 3px;    background-repeat: no-repeat;    background-size: contain;    padding-left: 38px;  }  .rechercheProduit .input-group-addon:hover {    color: #fbba00;  }  .text-upper-style {    text-transform: uppercase;  }
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />  <div class="col-xs-8 col-md-6">    <form class="form-horizontal rechercheProduit">      <div class="input-group">        <input class="form-control" placeholder="Rechercher un produit, une référence ..." type="text">        <span class="input-group-addon">          <span class="text-upper-style">            Rechercher</span>        </span>      </div>    </form>  </div>

You need of course to change the background-position, background-size, padding-left so it fits your image.

Adjust the background-size to define the size of the image, change the background-position to position the image inside the span and change the padding-left value to move the text further to the right.

Answers 7

You can override .glyphicon and set your image as a background for it and remove its icon

.rechercheProduit .input-group-addon span.glyphicon{     background: url(http://i.stack.imgur.com/vr0uy.png);     background-size: 100% 100%;     height: 24px;     width: 38px;     vertical-align: text-bottom;     margin: -6px -13px 0 0;     top: auto;     bottom: -6px;     z-index: 0; }  .rechercheProduit .input-group-addon span.glyphicon:before{     content:'';  // To remove its default icon } 

https://jsfiddle.net/ms5e0535/

Answers 8

You have to hide the default glyphicon then use custom image. Try these lines"

.glyphicon-search::before{ content:none!important; } .glyphicon-search{ background-image:url(../ur-image); height:20px; width:20px; background-repeat:no-repeat; background-size:cover; } 
Read More

Friday, April 22, 2016

Boostrap 3: Deselect tab using angular js

Leave a Comment

I'm working with angular js and bootstrap 3 and my app works like ... I have a view where you have several links which let you show a div with several tabs and select one of them. This works fine. But if I change the tab throug a clic over it and then I hide the view with the tabs when I make clic on another clic I show the view with the tabs, with the tab selected from the link, that's correct, but ... whith the previous tab clicked!!!

So, how I can deselect the tab where I have been make clic over it?

Thanks in advance!!!

Edit 1:

Hi!!! I'm going to post several screenshots to try to explain better my problem.

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

Edit 2:

I add this plunker to show how it works my code and you can check that if you clic on a tab, if later returns clicking a button you don't select the correct tab. https://plnkr.co/edit/y22T01OwxgttDWM1mJeH

HTML:

<body ng-controller="MainCtrl as ctrl">     <button id="bTab1" ng-click="ctrl.buttonClicked($event)">         Tab 1     </button>     <button id="bTab2" ng-click="ctrl.buttonClicked($event)">         Tab 2     </button>     <button id="bTab3" ng-click="ctrl.buttonClicked($event)">         Tab 3     </button>     <div ng-show = "ctrl.show_tabs">       <div class = "row" style = "text-align: right; margin-top: 10px">         <button ng-click="ctrl.closeTab()">             Hide Tabs         </button>       </div>       <ul class="nav nav-tabs" id="myTab">           <li ng-class = "ctrl.active_pai"><a data-target="#pai" data-toggle="tab">PAI</a></li>           <li ng-class = "ctrl.active_pap"><a data-target="#pap" data-toggle="tab">PAP</a></li>           <li ng-class = "ctrl.active_ip"><a data-target="#ip" data-toggle="tab">IP</a></li>         </ul>          <div class="tab-content">           <div class="tab-pane" ng-class = "ctrl.active_pai" id="pai">Content PAI</div>           <div class="tab-pane" ng-class = "ctrl.active_pap" id="pap">Content PAP</div>           <div class="tab-pane" ng-class = "ctrl.active_ip" id="ip">Content IP</div>         </div>           </div>  </body> 

Javascript:

var app = angular.module('plunker', []);  app.controller('MainCtrl', function($scope) { var self = this;  $scope.name = 'World'; self.show_tabs = false; self.active_pai = ""; self.active_pap = ""; self.active_ip = "";  self.buttonClicked = function(event) {   self.show_tabs = true;    if (event.currentTarget.id == "bTab1"){       self.active_pai = "active";       self.active_pap = "";       self.active_ip = "";   }    if (event.currentTarget.id == "bTab2"){       self.active_pai = "";       self.active_pap = "active";       self.active_ip = "";   }    if (event.currentTarget.id == "bTab3"){       self.active_pai = "";       self.active_pap = "";       self.active_ip = "active";   } };  self.closeTab = function(){   self.show_tabs = false; }  }); 

Anybody can help me, please? Thanks in advance!!!

Edit 3:

More problems!!! :(((

In my code, I've got tabs and boostrap calendar and with the given solution works fine without bootstrap calendar, but If add bootstrap calendar, this doesn't work correctly.

I have modified my origina plunker and I have added a bootstrap calendar and change these libraries:

<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/1.3.2/ui-bootstrap.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/1.3.2/ui-bootstrap-tpls.min.js"></script> 

By these:

<script type="text/javascript" src="bootstrap.min.js"></script> <script type="text/javascript" src="ui-bootstrap-tpls-0.14.3.min.js"></script>  

The code of these libraries you've got on the plunker. Plus I have added the controller which manage the bootstrap calendar.

Ok, If we go to the plunker: https://plnkr.co/edit/PaSqa0jxQjz48pzcmBMa

We can see that we have a bootstrap calendar where I cannot select day greater than today + 1. That's correct!!! But, If I make a click on button "Tab 2", the Tab that we can see is not 2, it's 1. If I do the same with tab 3, I've got the same result. That's wrong. The correct functionality is If I make a clic on button "Tab 2", we can see tab 2, for example.

Ok, If I change on the plunker these libraries ...

<script type="text/javascript" src="bootstrap.min.js"></script> <script type="text/javascript" src="ui-bootstrap-tpls-0.14.3.min.js"></script>  

By the given in the solution:

<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/1.3.2/ui-bootstrap.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/1.3.2/ui-bootstrap-tpls.min.js"></script> 

We can see that the tabs works correctly, but bootstrap calendar lets you to select days greaters than today + 1!!! And this is wrong!!!! :((((((

I hope it helps to understand my new problem :(((

This is frustrating!!!

Thanks in advance for your help!!!

1 Answers

Answers 1

I would recommend using angular-ui-bootstrap tabs for this. It provides angular wrappers around most of the bootstrap functionality (mostly directives), so it makes these types of things much easier to write (and code is cleaner, as you'll see below). I modified your plunkr as minimally as possible, but changed it to make use of the ui-bootstrap tabs: https://plnkr.co/edit/qqvY2acsZWbkyFCCT7qr?p=info

New Controller:

app.controller('MainCtrl', function($scope) {     var self = this;      $scope.name = 'World';      self.buttonClicked = function(index) {         self.show_tabs = true;         self.active = index;     };      self.closeTab = function(){         self.show_tabs = false;     }  }); 

Html changes:

<button id="bTab1" ng-click="ctrl.buttonClicked(1)">         Tab 1 </button> <button id="bTab2" ng-click="ctrl.buttonClicked(2)">         Tab 2 </button> <button id="bTab3" ng-click="ctrl.buttonClicked(3)">         Tab 3 </button> ... <div ng-show = "ctrl.show_tabs"> ...     <uib-tabset active="ctrl.active">         <uib-tab index="1" heading="PAI">Content PAI</uib-tab>         <uib-tab index="2" heading="PAP">Content PAP</uib-tab>         <uib-tab index="3" heading="IP">Content IP</uib-tab>     </uib-tabset> </div> 

ctrl.active, which is passed into the active attribute on <uib-tabset> just represents the index of the currently opened tab, so just changing its value will change which tab is open/visible. There are some more attributes that can be used for these directives (you can see them on the page I linked to above), but this shows the basis of how these tab directives can be used. I haven't seen the issue you were describing above after these changes.

Read More