从 C# 代码隐藏中打开 Facebox

发布于 2024-09-05 02:31:31 字数 345 浏览 2 评论 0原文

我正在创建一个基本的联系我们表单,其中包含一些字段和一个按钮。我正在使用 jquery Facebox 插件,我想在触发按钮单击事件后打开该插件,显示 div 标签内文本框之一的值。

例如

<div id="info" style="display:none;"><h1>Thanks for your enquiry</h1><p>Thanks [NAMEFIELD],<br /> Someone will be in contact with you shortly.</p>

任何提示都会很棒!

I am creating a basic contact us form that contains a few fields and a button. I am using the jquery facebox plugin which I want to open after the buttons click event is fired displaying a value from one of the textboxes within the div tag.

e.g.

<div id="info" style="display:none;"><h1>Thanks for your enquiry</h1><p>Thanks [NAMEFIELD],<br /> Someone will be in contact with you shortly.</p>

Any tips would be great!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深爱成瘾 2024-09-12 02:31:31

嗯..我可能错了...
但是你的初始化代码看起来像这样,对吗?

jQuery(document).ready(function($) {
  $('a[rel*=facebox]').facebox() 
})

为什么不模拟锚点的点击声呢?

就像

$('#contactUs').click();

Facebox 初始化之后一样(仍在文档内准备好)。

编辑:

如果你真的想要“服务器端”的东西,你可以有一个方法来插入JavaScript来触发点击。

Well.. I can be wrong here...
But your initialization code looks like this, right?

jQuery(document).ready(function($) {
  $('a[rel*=facebox]').facebox() 
})

Why don't you emulate the click of your anchor?

like

$('#contactUs').click();

after the facebox initialization (still inside document ready).

EDIT:

If you really want the "server-side" of things you can have a method to insert the javascript to trigger the click from it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文