Commit b891384c by lmf

优化模拟点击事件

parent 9b4b3e57
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
$label = $block->getChildData($alias, 'title'); $label = $block->getChildData($alias, 'title');
?> ?>
<div class="data item title" <div class="data item title"
data-role="collapsible" id="tab-label-<?= $block->escapeHtmlAttr($alias) ?>" role="tab" data-collapsible="true" aria-controls="reviews" aria-selected="true" aria-expanded="true" tabindex="0" > data-role="collapsible" style="display: none" id="tab-label-<?= $block->escapeHtmlAttr($alias) ?>" role="tab" data-collapsible="true" aria-controls="reviews" aria-selected="true" aria-expanded="true" tabindex="0" >
<a class="data switch" <a class="data switch"
tabindex="-1" tabindex="-1"
data-toggle="trigger" data-toggle="trigger"
...@@ -41,9 +41,13 @@ ...@@ -41,9 +41,13 @@
require([ require([
'jquery' 'jquery'
], function ($) { ], function ($) {
console.log("jquery is work!")
setTimeout(function(){ setTimeout(function(){
$("#tab-label-reviews").trigger("click"); $("#tab-label-reviews").trigger("click");
},1000); },1000);
}); });
let e = document.createEvent('MouseEvents');
e.initEvent('click', true, true);
document.getElementById('tab-label-reviews').dispatchEvent(e);
</script> </script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment