简体   繁体   English

如何将JavaScript与mdl-layout--fixed-tabs结合使用

[英]How can I use JavaScript with mdl-layout--fixed-tabs

I looked at numerous examples of mdl-layout--fixed-tabs usage . 我看了无数mdl-layout--fixed-tabs usage示例。

I can't find any example of using mdl-layout--fixed-tabs with JavaScript. 我找不到在JavaScript中使用mdl-layout--fixed-tabs任何示例。 My goal is to make different REST backend calls depending on active tab. 我的目标是根据活动选项卡进行不同的REST后端调用。

MDL is just a collection of CSS classes, each applied to an HTML element. MDL只是CSS类的集合,每个CSS类都应用于HTML元素。

JavaScript is used to manipulate the HTML underneath the MDL classes, so you just use JavaScript with MDL like you would with regular HTML. JavaScript用于操作MDL类下的HTML,因此您只需将JavaScript与MDL一起使用,就像使用常规HTML一样。

var tab1 = document.getElementById("tab1"); // Where tab1 is the ID of
                                            // of your HTML element with
                                            // the applied MDL class.
// Do whatever else you need to do, etc...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM