[英]Javascript pop up window css and click function
I have a pop up window which contains form to fill out the details. 我有一个弹出窗口,其中包含用于填写详细信息的表单。 My need is, I need to show the form inside the pop up window with the css styles applied to it.
我需要的是,我需要在弹出窗口中显示具有应用CSS样式的表单。
Currently I have loaded the form inside the pop up window but it is not taking the style applied to it. 目前,我已经在弹出窗口中加载了表单,但是没有采用所应用的样式。 How do I get the styles to be applied on it.
如何获得要应用的样式。 (I don't want to load the .html page in windows pop up)
(我不想在Windows弹出窗口中加载.html页面)
When I click on the submit link in the pop up, it should clone the .clone
div on the page and pop up should get closed. 当我单击弹出窗口中的
.clone
链接时,它应在页面上克隆.clone
div并关闭弹出窗口。
here is my current js 这是我目前的js
function myFunction() {
var myWindow = window.open("", "MsgWindow", "width=500, height=400");
myWindow.document.write($(".content").html());
myWindow.document.close();
}
Any help is much appreciated. 任何帮助深表感谢。 Thank you!
谢谢!
put ur css
inside the div
' content
' 将ur
css
放入div
“ content
”
check this link http://jsfiddle.net/erv3ebj1/5/ 检查此链接http://jsfiddle.net/erv3ebj1/5/
Adding some like this may work 像这样添加一些可能
myWindow.append($("<link/>",
{ rel: "stylesheet", href: "file://path/to/style.css", type: "text/css" }));
尝试在隐藏的iframe中打开它,直到需要它为止。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.