【问题标题】:jQuery colorbox outside HTML with inline call带有内联调用的 HTML 外的 jQuery 颜色框
【发布时间】:2013-11-28 15:04:20
【问题描述】:

如何从颜色框中获得响应(例如提交按钮)?

index.html

$(document).ready(function(){

    $(".myclass").colorbox({width:"75%", height:"75%"});

    $('#btn').click(function(){
       $("#test").val("it works!");
    });
});

<body>
    <a class='myclass' href="1.html">Click to show the Colorbox</a>
</body>

1.html

<input type="text" id="test">
<input type="submit" id="btn">

当我点击提交按钮时,什么也没有发生。如何调用彩盒的内容并更改内容?

【问题讨论】:

    标签: jquery html call colorbox inline


    【解决方案1】:

    像这样更改您的代码:

            $(document).ready(function () {
               $(".myclass").colorbox({
                  width: "75%",
                  height: "75%",
                  onComplete: function () {
                    $('#btn').click(function () {
                        $("#test").val("it works!");
                    });
                  }
               });           
             });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-21
      • 2011-03-07
      相关资源
      最近更新 更多