有没有办法在物化CSS标签上通过AJAX加载标签内容,类似于jQuery UI? https://jqueryui.com/tabs/#ajax
答案 0 :(得分:0)
您可以使用jQuery UI选项卡,并按照
进行操作$( function() {
$( "#tabs" ).tabs({
beforeLoad: function( event, ui ) {
ui.jqXHR.fail(function() {
ui.panel.html(
"Couldn't load this tab. We'll try to fix this as soon as possible. " +
"If this wouldn't be a demo." );
});
确保在Materialise CSS中包含选项卡ID,并在实现CSS之前包含脚本选项卡。
答案 1 :(得分:0)
您可以滚动自己的AJAX请求并定位标签,如下所示:
$(document).on('click', '.tab', (function(e){
var url = $(this).find('a').attr('href');
e.preventDefault();
$.ajax({
type: "GET",
url: url,
data: { },
success: function(data){
$('#targetElement').html(data);
}
});
});