Last active
November 10, 2017 23:34
-
-
Save NathanQ/f102620ebb92ebe36a33f8730b00fb49 to your computer and use it in GitHub Desktop.
Revisions
-
NathanQ revised this gist
Nov 10, 2017 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,20 +10,20 @@ $(function() { }); // make things in a group the same height function sameHeightenate(groupToSameHeight, sameHeighters) { $(groupToSameHeight).each(function() { var tallest = 0; $(sameHeighters, $(groupToSameHeight)).each(function() { tallest = tallest > $(this).height() ? tallest: $(this).height(); }); $(sameHeighters, $(groupToSameHeight)).each(function() { $(this).height(tallest); }); }); } $(function() { // example sameHeightenate('.card-group.row', '.card'); sameHeightenate('.carousel.row', '.carousel-item'); }); -
NathanQ revised this gist
Nov 10, 2017 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ $(function() { }); // make things in a group the same height function sameHeightenator(groupToSameHeight, sameHeighters) { $(groupToSameHeight).each(function() { var tallest = 0; $(sameHeighters).each(function() { @@ -24,6 +24,6 @@ function sameHeightenate(groupToSameHeight, sameHeighters) { $(function() { // example sameHeightenator('.card-group.row', '.card'); sameHeightenator('.carousel.row', '.carousel-item'); }); -
NathanQ revised this gist
Nov 10, 2017 . 1 changed file with 15 additions and 22 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,28 +9,21 @@ $(function() { }); }); // make things in a group the same height function sameHeightenate(groupToSameHeight, sameHeighters) { $(groupToSameHeight).each(function() { var tallest = 0; $(sameHeighters).each(function() { tallest = tallest > $(this).height() ? tallest: $(this).height(); }); $(sameHeighters).each(function() { $(this).height(tallest); }); }); } $(function() { // example sameHeightenate('.card-group.row', '.card'); sameHeightenate('.carousel.row', '.carousel-item'); }); -
NathanQ created this gist
Sep 12, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ // scroll to heading of open collapse item so content is presented on the screen $(function() { $('.panel-collapse').on('shown.bs.collapse', function (e) { var $panel = $(this).closest('.panel'); $('html,body').animate({ scrollTop: $panel.offset().top }, 250); }); }); // make all bootstrap tabs the same height independent of their content so they look regular. $(function() { var tallestTab = 0; $('.nav-tabs a').each(function() { tallestTab = tallestTab > $(this).height() ? tallestTab: $(this).height(); }); $('.nav-tabs a').each(function() { $(this).height(tallestTab); }); }); // make all bootstrap carousel items the same height so there's no jumpiness on carousel transitions $(function() { var tallestCarouselItem = 0; $('.carousel .item').each(function() { tallestCarouselItem = tallestCarouselItem > $(this).height() ? tallestCarouselItem: $(this).height(); }); $('.carousel .item').each(function() { $(this).height(tallestCarouselItem); }); });