$(document).ready(function () {
$(".main").onepage_scroll({
sectionContainer: "section",
responsiveFallback: 600,
loop: true
});
});
当点击运行按钮调用“nwin”函数时,在该函数中我可以使用open()打开新窗口,那个时候我正在使用这个函数但是这不是加载功能新窗口是打开的。
这里是按钮代码,
<div class="resultContainer">
<div style="height:400px;">
<div style="float:left; width:100%; height: 93px; margin: 20px 0 0 60px;"> <span class="containerTitle" style=" top: 65px;">
<a href="javascript:;" class="button_example" id="result" style="color: white;">Result</a></span>
</div>
</div>
点击此通话功能
$("a#result").click(nWin);
var htmlEditor = CodeMirror.fromTextArea(document.getElementById("html"), {
lineNumbers: true,
mode: "text/html",
matchBrackets: true
});
function nWin() {
htmlEditor.save();
var w = window.open();
$(w.document.head).load(function () {
$(".main").onepage_scroll({
sectionContainer: "section",
responsiveFallback: 600,
loop: true
});
});
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "jquery.onepage-scroll.js";
$(w.document.head).append(script);
$(w.document.head).append('<link rel="stylesheet" href="onepage-scroll.css" type="text/css" />');
$(w.document.head).append('<link rel="stylesheet" href="demo_data.css" type="text/css" />');
$(w.document.head).append("<style>" + $('#css').val() + "</style>" + $('#js').val());
$(w.document.body).html($('#html').val());
}