// Buttons $('.fixed-action-btn').openFAB(); $('.fixed-action-btn').closeFAB(); // Forms - Select $('select').material_select(); $('select').material_select('destroy'); // Forms - Date Picker $('.datepicker').pickadate({ selectMonths: true, // Creates a dropdown to control month selectYears: 15 // Creates a dropdown of 15 years to control year }); // Forms - Character Counter $('input#input_text, textarea#textarea1').characterCounter(); // Navbar $(".dropdown-button").dropdown(); $(".dropdown-button").dropdown({ hover: false }); $(".button-collapse").sideNav(); // Collapsible var collapseHtml = ''; $(collapseHtml).collapsible({ accordion: false, onClose: function () { alert('Closed'); } }); $(collapseHtml).collapsible({ accordion: true, onOpen: function () { alert('Opened'); } }); // Dialogs - Toasts Materialize.toast('I am a toast!', 4000); Materialize.toast('I am a toast!', 3000, 'rounded'); Materialize.toast('I am a toast!', 3000, 'rounded', () => console.log('callback')); var $toastContent = $('I am toast content'); Materialize.toast($toastContent, 5000); // Dialogs - Tooltip var tooltipHtml = 'Hover me!'; $(tooltipHtml).tooltip(); $(tooltipHtml).tooltip({ delay: 100 }); $(tooltipHtml).tooltip('remove'); // DropDown var dropDownHtml = 'Drop Me!'; $(dropDownHtml).dropdown({ inDuration: 300, outDuration: 225, constrainWidth: false, // Does not change width of dropdown to that of the activator hover: true, // Activate on hover gutter: 0, // Spacing from edge belowOrigin: false, // Displays dropdown below the button alignment: 'left', // Displays dropdown with edge aligned to the left of button stopPropagation: false // Stops event propagation }); $(dropDownHtml).dropdown({}); // Media - materialbox var materialboxHtml = ''; $(materialboxHtml).materialbox(); // Media - slider var sliderHtml = '
' + '' + '
'; $(sliderHtml).slider(); $(sliderHtml).slider({}); $(sliderHtml).slider({ indicators: true }); $(sliderHtml).slider({ indicators: true, height: 5 }); $(sliderHtml).slider({ indicators: true, height: 5, transition: 4 }); $(sliderHtml).slider({ indicators: true, height: 5, transition: 4, interval: 5 }); // Carousel $('.carousel').carousel(); $('.carousel').carousel({}); $('.carousel').carousel({ duration: 200, dist: -100, shift: 500, padding: 6000, fullWidth: true, indicators: false, noWrap: false }); // Next slide $('.carousel').carousel('next'); $('.carousel').carousel('next', 3); // Move next n times. // Previous slide $('.carousel').carousel('prev'); $('.carousel').carousel('prev', 4); // Move prev n times. // Modals var modalhtml = ''; $(modalhtml).modal('open'); $(modalhtml).modal('close'); var modalTriggerHtml = ''; $(modalTriggerHtml).modal(); $(modalTriggerHtml).modal({}); $(modalTriggerHtml).modal({ dismissible: true }); $(modalTriggerHtml).modal({ dismissible: true, opacity: 1 }); $(modalTriggerHtml).modal({ dismissible: true, opacity: 1, inDuration: 100 }); $(modalTriggerHtml).modal({ dismissible: true, opacity: 1, inDuration: 100, outDuration: 100 }); $(modalTriggerHtml).modal({ dismissible: true, opacity: 1, inDuration: 100, outDuration: 100, startingTop: "4%" }); $(modalTriggerHtml).modal({ dismissible: true, opacity: 1, inDuration: 100, outDuration: 100, startingTop: "4%", endingTop: "10%" }); $(modalTriggerHtml).modal({ dismissible: true, opacity: 1, inDuration: 100, outDuration: 100, startingTop: "4%", endingTop: "10%", ready: () => console.log('ready') }); $(modalTriggerHtml).modal({ dismissible: true, opacity: 1, inDuration: 100, outDuration: 100, startingTop: "4%", endingTop: "10%", ready: () => console.log('ready'), complete: () => console.log('complete') }); // Parallax var parallaxHtml = '
' + '
' + '
'; $(parallaxHtml).parallax(); // PushPin $('
').pushpin(); $('
').pushpin({ top: 1 }); $('
').pushpin({ top: 1, bottom: 1 }); $('
').pushpin({ top: 1, bottom: 1, offset: 2 }); // ScrollFire var options = [ { selector: '.class', offset: 200, callback: 'console.log(".class")' }, { selector: '.other-class', offset: 200, callback: 'console.log(".other-class")' }, ]; Materialize.scrollFire(options); // ScrollSpy var scrollSpyHtml = '
' + '
' + '
' + '

Content

' + '
' + '
' + '

Content

' + '
' + '
' + '

Content

' + '
' + '
' + '
' + '' + '
' + '
'; $(scrollSpyHtml, ".scrollspy").scrollSpy(); // Side-Nav var sideNavHtml = ''; $(sideNavHtml).sideNav(); $(sideNavHtml).sideNav({}); $(sideNavHtml).sideNav({ menuWidth: 100 }); $(sideNavHtml).sideNav({ menuWidth: 100, edge: 'right' }); $(sideNavHtml).sideNav({ menuWidth: 100, edge: 'right', closeOnClick: true }); $(sideNavHtml).sideNav({ menuWidth: 100, edge: 'right', closeOnClick: true, draggable: false }); $(sideNavHtml).sideNav("show"); $(sideNavHtml).sideNav("hide"); // Tabs var tabsHtml = '
' + '
' + '' + '
' + '
Test 1
' + '
Test 2
' + '
Test 3
' + '
Test 4
' + '
'; $(tabsHtml).tabs(); $(tabsHtml).tabs('select_tab', 'test1'); $(tabsHtml).tabs({ onShow: (currentTab: any) => { console.log(currentTab) }, swipeable: false, responsiveThreshold: 5000 }); // Transitions Materialize.showStaggeredList('#staggered-test'); Materialize.updateTextFields(); let chipsHTML = '
' + '
' + '
' + '
'; $(chipsHTML).material_chip(); $(chipsHTML).material_chip({ data: [{ tag: 'Apple', }, { tag: 'Microsoft', }, { tag: 'Google', }], }); $('.chips-placeholder').material_chip({ placeholder: 'Enter a tag', secondaryPlaceholder: '+Tag', }); $('.chips-autocomplete').material_chip({ autocompleteData: { 'Apple': null, 'Microsoft': null, 'Google': null } }); let chipData: Materialize.ChipDataObject | Materialize.ChipDataObject[] = $('.chips-initial').material_chip('data');