I tried to use the example code on the official doc page.
But still it wont work…
https://materializecss.com/tabs.html
https://codepen.io/zhouxiang19910319/pen/QWbdxmN?editors=1010
Does anyone know why???
I tried to use the example code on the official doc page.
But still it wont work…
https://materializecss.com/tabs.html
https://codepen.io/zhouxiang19910319/pen/QWbdxmN?editors=1010
Does anyone know why???
// jQuery code
$(document).ready(function(){
$('.tabs').tabs();
});
materialize.min.js
(change the load order under the JS section).I see… Thanks. (20 character)
No problem.
Here is it with plain JS and the options object with the default values. You can check the docs to see what the options are for.
window.addEventListener("DOMContentLoaded", event => {
const options = {
duration: 300,
onShow: null,
swipeable: false,
responsiveThreshold: Infinity
};
const tabsContainer = document.querySelector(".tabs");
M.Tabs.init(tabsContainer, options);
});
ah… thank you so much… I just got into js… I was too shy to ask you to do the javascript version. LOL.