在Magento 1.9中单击按钮时打开花哨的框

Open fancy box on button click in Magento 1.9

本文关键字:开花 按钮 Magento 单击      更新时间:2023-09-26

我想在点击按钮时在花哨的框中打开HTML表单。

目前表格在页面底部打开,而不是在花哨的框中打开。

请查看我的代码

布局/自定义模块.xml文件

<default>
    <reference name="head">
        <action method="addItem"><type>skin_js</type><name>js/custom_module/custommodule.js</name></action>
        <action method="addJs"><script>custom_module/jquery-1.9.0.min.js</script></action>
        <action method="addJs"><script>custom_module/jquery.fancybox.js</script></action>
        <action method="addJs"><script>custom_module/jquery.fancybox.pack.js</script></action>
        <action method="addJs"><script>custom_module/jquery.mousewheel-3.0.6.pack.js</script></action>
        <action method="addJs"><script>custom_module/jquery.noconflict.js</script></action>
        <action method="addCss"><stylesheet>css/custom_module/custommodule.css</stylesheet></action>
        <action method="addCss"><stylesheet>css/custom_module /jquery.enter code herefancybox.css</stylesheet></action>
    </reference>
</default>

自定义模块.js打开花式盒子的文件代码

function loadcustomform(reloadurl){
new Ajax.Request(reloadurl, {
    method: 'post',
    parameters: Form.serialize($('product_addtocart_form')),
    onSuccess: function(transport) {
        var json = transport.responseText.evalJSON();
        var displayString = json.message;
        if(json.success) {
            jQuery('body').append('<div id="output-div"></div>');
            jQuery('#output-div').html('');
            jQuery('#output-div').html(json.request_form);
            jQuery.fancybox({
                type: 'ajax',
                width:200,
                height:100,
                fitToView: false,
                content: jQuery('#output-div'),
                modal: false
            });
        }
    }
});

}

提示:如果我评论该行

<action method="addItem"><type>skin_js</type><name>js/lib/jquery-1.10.2.min.js</name></action> 

frontend/rwd/default/layout/page.xml,然后花式盒子正确打开。

请帮我解决这个问题。谢谢。

<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function(){
jQuery(".fancybox").fancybox({
        openEffect  : 'none',
        closeEffect : 'none',
        iframe : {
            preload: false
        }
    });
});     
</script>
<script type="text/javascript" src="http://dev.smartparcelbox.com/skin/frontend/rwd/default/js/jquery.fancybox.pack.js"></script>