colorbox Jquery插件,试图打开第二个弹出窗口

时间:2013-02-11 16:11:15

标签: jquery colorbox

我是usinc colorbox打开弹出#1:

<li class="getquotebtn"><a href="<?php bloginfo ('template_directory'); ?>/get-quote.php?productID=<?php echo $post->ID; ?>">Get Quote</a></li>

和jquery:

$('.getquotebtn a').colorbox();

这很好用。但是我在get-quite.php的内容中有另一个按钮,我想打开另一个弹出窗口......

<form name="getquotedata" action="" method="post">
        <input type="text" name="nameandsurname" id="popupnamefield" onblur="this.value=!this.value?'<?php _e('Name and Surname','medishop'); ?>':this.value;" onfocus="this.select()" onclick="if (this.value=='<?php _e('Name and Surname','medishop'); ?>'){this.value='';}" value="<?php _e('Name and Surname','medishop'); ?>">
        <input type="text" name="email" id="popupemailfield" onblur="this.value=!this.value?'youremail@domain.com':this.value;" onfocus="this.select()" onclick="if (this.value=='youremail@domain.com'){this.value='';}" value="youremail@domain.com">
        <input type="hidden" name="prod_ID" value="<?php echo $productID_from_url; ?>">
        <input type="hidden" name="prod_name" value="<?php echo get_the_title($productID_from_url); ?>">
        <input type="hidden" name="prod_url" value="<?php echo get_permalink($productID_from_url); ?>">
            <input type="submit" value="Get Quote" id="popupsbmt" onclick="$.colorbox({href:'<?php bloginfo('template_directory'); ?>/get-quote-sendmail.php'}); return false;">
    </form>

这就是问题的起点!

我收到错误:This content failed to load.

任何想法如何解决这个问题?

谢谢!

1 个答案:

答案 0 :(得分:0)

将颜色框放入另一个颜色框时,一切似乎都能正常工作,请参阅live example here

<a class='inline' href="#inline_content">Inline HTML</a>
<div style='display:none'>
    <div id='inline_content' style='padding:10px; background:#fff;'>
        <a class='inline2' href="#inline_content2">open second</a>
    </div>
</div>
<div style='display:none'>
    <div id='inline_content2' style='padding:10px; background:#fff;'>hi second</div>
</div>

JS:

$(".inline").colorbox({inline:true, width:"50%"});
$(".inline2").colorbox({inline:true, width:"50%"});