- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试向网站添加电子邮件服务。我弹出了一个带有 Shadowbox 的模式消息窗口(因为我已经在网站上将 Shadowbox 用于其他目的)。
问题是,我似乎无法将变量传递到打开的消息表单中。
我这样调用窗口
$(document).on("click","#mail",function(e){
e.preventDefault();
var thisParentClass = $(this).parent().attr("class");
alert (thisParentClass);
var thisIDpos = thisParentClass.indexOf("id-")+3;
var thisID = thisParentClass.substr(thisIDpos, 3);
alert(thisID);
Shadowbox.open({
content: '<form method="post" class="mailForm" action="#"><input type="hidden" name="memberID" value=thisID><p>Please be advised that the member may not be actively receiving mail.. or they might just not care at all. They have lives too you know.</p>Your E-mail:<input type="text" name="fromEmail" size="25"> <br>Your Name: <input type="text" name="fromName" size="25"> <br>Your Message: <br><textarea cols="50" rows="5" name="nMessage">Your Message Here...</textarea> <br><button type="submit" onclick="return false;" id="mailSubmit" value="Submit">Submit</button> ',
player: "html",
height: 350,
width: 350,
options: {modal:true}
});
我的所有警报都返回正确的值,但 [thisID] 没有进入我的消息表单。我只是不断获取“value =“thisID””的 HTML(请注意,无论我是否添加引号,引号都会包围我的变量)。有什么办法可以输入这个变量,或者我必须切换到另一个解决方案吗? (我希望我的窗口看起来都一样,所以如果我不能在这里使用 Shadowbox,我将不得不更改所有我的实现。B*tch。
我没有收到来自 Shadowbox 论坛的注册邮件,因此出于某种原因我可以在那里问这个问题,所以我想我应该在这里问。
想法?
最佳答案
替换这个:
<input type="hidden" name="memberID" value=thisID>
进入此:
<input type="hidden" name="memberID" value='+thisID+'>
您需要使用 + 符号将 thisID 的值连接到完整字符串中。
完整代码:
$(document).on("click","#mail",function(e){
e.preventDefault();
var thisParentClass = $(this).parent().attr("class");
alert (thisParentClass);
var thisIDpos = thisParentClass.indexOf("id-")+3;
var thisID = thisParentClass.substr(thisIDpos, 3);
alert(thisID);
Shadowbox.open({
content: '<form method="post" class="mailForm" action="#"><input type="hidden" name="memberID" value='+thisID+'><p>Please be advised that the member may not be actively receiving mail.. or they might just not care at all. They have lives too you know.</p>Your E-mail:<input type="text" name="fromEmail" size="25"> <br>Your Name: <input type="text" name="fromName" size="25"> <br>Your Message: <br><textarea cols="50" rows="5" name="nMessage">Your Message Here...</textarea> <br><button type="submit" onclick="return false;" id="mailSubmit" value="Submit">Submit</button> ',
player: "html",
height: 350,
width: 350,
options: {modal:true}
});
关于javascript - 将变量传递到 Shadowbox 模态窗口?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9532674/
我想知道是否有办法在关闭 Shadowbox 时重新加载父页面。基本上我有一个页面,其中列出了我的所有类别。我使用shadowbox来调用edit.php?页面来完成我所有的编辑,我想重新加载称为sh
好吧,我正在使用 Shadowbox,它本身就是一个 jQuery Lightbox,根据 Firebug 的说法,它可能会破坏我的代码。 这是确切的错误: Error: Shadowbox is n
我能够将shadowbox设置为在页面加载时初始化以显示照片,但我需要它来显示一堆照片,在查看shadowbox站点后,我找不到如何执行此操作。页面 html: Shadowbox.init()
我真的很挣扎...... 我设置了一个非常简单的 window.onload Shadowbox.js 弹出窗口 但是,当我尝试在我正在创建的开发 WordPress 网站上使用相同的代码时,shad
我正在使用 shadowbox js 在灯箱样式弹出窗口中显示 Flash 视频。 到目前为止一切正常,但我遇到了这个问题: 当页面加载并且用户过早点击应该打开的链接图像时shadowbox swf
我有一个 XHTML 1.0 Strict 文档,我在其中尝试使 Shadowbox 工作。 Test page Sha
我正在使用 shadowbox 和 jQuery。 我可以在页面加载时正常打开它。 我想做的是。 打开 shadowbox 并显示一个表单,用户可以在其中输入他们的电子邮件地址。 然后我想通过 aja
嘿伙计们,我正在尝试获取 Shadowbox上类。每当我单击该链接时,它都会在新页面中打开电影。这是 head 标签中的代码: Shadowbox.init({ players: ["qt"];
我正在尝试使用 shadowbox.js 打开当前网页顶部的图像。但是,当我单击链接时,它会将我带到我的图像,并且下面的页面会转到空白页面。有谁知道如何在将我的当前页面保持在下方的同时打开阴影框? 这
如何使用 AJAX 将 Shadowbox 绑定(bind)/初始化到 jQuery 加载的内容? 现在,当我第一次进入该网站时,shadowbox 就可以工作了。 但是,当我将内容与通过 AJAX
这个覆盖似乎是唯一可以在我的学校古怪模板中工作的覆盖插件...但问题是,当浏览器调整大小时,阴影框也会调整大小,从而剪切其中的内容。我希望它能够固定框统计信息,并且如果浏览器确实变小,浏览器将有滚动条
我正在尝试向网站添加电子邮件服务。我弹出了一个带有 Shadowbox 的模式消息窗口(因为我已经在网站上将 Shadowbox 用于其他目的)。 问题是,我似乎无法将变量传递到打开的消息表单中。 我
我无法使shadowbox 工作...我有一个静态html 页面,其中有一个图像作为在shadowbox 中打开swf 的链接。但是,当我单击图像时,它会像浏览器中的任何其他图像文件一样打开 swf。
我正在玩 shadowbox,我想在用户登陆我网站的索引页面时启动它。 我可以像那样使用阴影框: title Shadowbox.init(); My Image 我尝试制作
我确定我不是第一个遇到这个问题的人,但我还没有找到解决方案。 我正在使用 Shadowbox以最简单的形式;只是用像这样的链接做一个图像弹出窗口 Click here to view the imag
我正在尝试为图像添加描述。我知道您可以添加标题,但我正在寻找描述和标题。谁能告诉我实现此目标的最佳方法,或者是否可能? 提前致谢 最佳答案 您需要将 title 属性与如下所示的一些 HTML 一起使
所以我的网站使用shadowbox做显示一些动态文本。问题是我需要用户能够复制和粘贴该文本。 右键单击并选择复制有效,但 Ctrl+C 无效(没有键盘快捷键有效),大多数人使用 Ctrl+ C?你可以
我在我的页面上使用 Shadowbox:http://www.shadowbox-js.com/index.html 我在同一页面上的 2 个独立网络用户控件上有 2 个链接,它们应该打开 2 个不同
Firefox 中的 Shadowbox 总是显示滚动条;使用 Chrome、IE 和 Safari 可以正常工作。任何人都知道如何解决这个问题?我在 shadowbox.css 中尝试了不同的东西,
我试图在代码的 .top_section 底部放置一个阴影。但是,我无法使其工作。我有两个部分(顶部和底部),阴影需要低于 .top_section 代码如下: CSS: .top_section {
我是一名优秀的程序员,十分优秀!