我有一个网站,我试图在网站加载时使用jQuery自动点击图片。我正在使用wordpress,并且代码在页脚中实现。该站点为https://mobimania.si/trgovina/ovitek-print-gold-mandala-copy/,实际图片位于“ IZBERI MOTIV”部分。
我有代码,但由于某种原因它不起作用
jQuery("document").ready(function($) {
setTimeout(function() {
$("#mCSB_4.fpd-grid.fpd-item>picture").trigger('click');
}, 10);
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<div id="mCSB_4" class="mCustomScrollBox mCS-light mCSB_vertical mCSB_outside" style="max-height: none;" tabindex="0">
<div id="mCSB_4_container" class="mCSB_container mCS_y_hidden mCS_no_scrollbar_y" style="position:relative; top:0; left:0;" dir="ltr">
<div class="fpd-grid fpd-grid-contain fpd-padding">
<div class="fpd-item fpd-hidden" data-title="252105" data-source="/wp-content/uploads/2019/02/252105-e1551204819312.jpg" data-search="252105">
<picture data-img="/wp-content/uploads/2019/02/252105-e1551204819312-188x300.jpg"></picture>
</div>
</div>
</div>
</div>
慕虎7371278
相关分类