$('.menu div.profile-btn').on('click', function () {
$('.mainservice-page').fadeIn(1200);
}
上面的脚本.mainservice-page
成功打开了div的内容,但是我想在新选项卡中打开它们。
我怎样才能做到这一点?
提前致谢。
您可以这样:
function newWindow_method_1() {
var wi = window.open();
var html = $('.mainservice-page').html();
$(wi.document.body).html(html);
}
OR
function newWindow_method_2() {
var html = $('.mainservice-page').html();
window.open(html, "__new", "width=1000,height=1000");
}
$('.menu div.profile-btn').on('click', function () {
newWindow_method_1();
// OR
// newWindow_method_2();
});
希望这会帮助你。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句