【发布时间】:2013-12-30 16:29:46
【问题描述】:
我在magento hrader.phtml 文件中有fancybox 弹出窗口,当您单击链接时弹出窗口工作正常。但我想不点击但根据 php 代码中的 if 语句触发fancybox。弹出窗口的链接与 php 工作正常,弹出窗口将打开。
我不确定问题是 jQuery 和 magento 冲突,还是花哨的盒子有其他问题。这是我的代码
if ($display_popup == 1) {
echo "<br> DISPLAY POPUP";
?>
<a id="inline" href="#thankyou">popup</a>
<script type="text/javascript">
//open_popup_auto();
//jQuery.noConflict();
$(document).ready(function() {
$("#thankyou").fancybox().trigger('click');
alert('working cooool');
});
/*$(document).ready(function () {
$.fancybox({
'width': '40%',
'height': '40%',
'autoScale': true,
'transitionIn': 'fade',
'transitionOut': 'fade',
'type': 'iframe',
'href': 'http://www.google.com'
});
}); */
</script>
【问题讨论】: