0
正在使用此模态弹出代码http://www.queness.com/post/77/simple-jquery-modal-window-tutorial并使用“简单模态窗口”链接。在模态弹出窗口中显示Textarea文本
如果该页面上有一个textarea框。我将如何显示模态窗口上的文本?
该代码正在php网站上使用。
正在使用此模态弹出代码http://www.queness.com/post/77/simple-jquery-modal-window-tutorial并使用“简单模态窗口”链接。在模态弹出窗口中显示Textarea文本
如果该页面上有一个textarea框。我将如何显示模态窗口上的文本?
该代码正在php网站上使用。
这是未经测试的,但你可以做的是添加一些代码到模态的点击功能来抓取textarea的文本,然后传递给模态本身。这将是这样的,假设你有一个名为myTextArea
textarea的:
$('a[name=modal]').click(function(e) {
//Cancel the link behavior
e.preventDefault();
//This is the added part:
//Get the textarea's text
var taText = $('textarea#myTextArea').val();
//Example - Now add the text to a span tag inside the modal
("#myDiv span").text(taText);
...
这应该有希望做到这一点。