JAVASCRIPT   19

application.js

Guest on 5th June 2021 05:29:10 PM

  1. // ++++++++++++++++++++++++++++++++++++++++++++++++
  2. // NOTICE!! THIS JAVASCRIPT IS USED JUST FOR DOCS
  3. // YOU MAY NEED SOME CODE FOR YOUR PROJECT
  4. // NOT INCLUDE THIS FILES AS IS
  5. // ++++++++++++++++++++++++++++++++++++++++++++++++
  6.  
  7. !function ($) {
  8.  
  9.   $(function(){
  10.  
  11.     // Disable links in docs
  12.     $('[href^=#]').click(function (e) {
  13.       e.preventDefault()
  14.     })
  15.  
  16.     /////////////////////////////
  17.     // ACCORDION ICON TOGGLE
  18.     /////////////////////////////
  19.     var iconOpen = 'fa-minus',
  20.         iconClose = 'fa-plus';
  21.  
  22.     $(document).on('show.bs.collapse hide.bs.collapse', '.accordion', function (e) {
  23.         var $target = $(e.target)
  24.           $target.siblings('.accordion-heading')
  25.           .find('em').toggleClass(iconOpen + ' ' + iconClose);
  26.           if(e.type == 'show')
  27.               $target.prev('.accordion-heading').find('.accordion-toggle').addClass('active');
  28.           if(e.type == 'hide')
  29.               $(this).find('.accordion-toggle').not($target).removeClass('active');
  30.     });
  31.  
  32.  
  33.     /////////////////////////////
  34.     // TYPEAHEAD (autocomplete)
  35.     /////////////////////////////
  36.  
  37.     /* Bootstrap 3 doesn't include typeahead so*/
  38.     $('[data-provide="typeahead"]').typeahead({
  39.       name: "states",
  40.       local: ["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Dakota","North Carolina","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"],
  41.       limit: 4
  42.     });
  43.  
  44.  
  45.  
  46.     // tooltip demo
  47.     $("[data-toggle=tooltip]").tooltip();
  48.  
  49.     // popover demo
  50.     $("[data-toggle=popover]")
  51.       .popover()
  52.  
  53.     // button state demo
  54.     $('#fat-btn')
  55.       .click(function () {
  56.         var btn = $(this)
  57.         btn.button('loading')
  58.         setTimeout(function () {
  59.           btn.button('reset')
  60.         }, 3000)
  61.       })
  62.  
  63.     // carousel demo
  64.     $('#myCarousel').carousel();
  65.     $('#myCarouselV').carousel();
  66.  
  67.   })
  68. }(window.jQuery)

Raw Paste


Login or Register to edit or fork this paste. It's free.