如何在新选项卡中打开DIV标签内的内容
How to open the content inside a DIV tag in new tab
$('.menu div.profile-btn').on('click', function () {
$('.mainservice-page').fadeIn(1200);
}
上面的脚本成功地打开了div .mainservice-page
的内容,但是我想在一个新的选项卡中打开它们。
我该怎么做呢?
提前感谢。
你可以这样做:
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();
});
相关文章:
- 隐藏 DIV 标签,直到填充所有文本字段
- 如何将选定的日期月份和年份打印到不同的DIV标签中
- 使用 Div 标签的 location.href 属性时,Eval 不起作用
- For循环只打印一个DIV标记.不是8个DIV标签
- 清除 DIV 标签不起作用
- DIV 标签显示:内联块;
- 在自动刷新 DIV 标签内的 PHP 中表单将不起作用
- DIV标签和HTML5元素之间应该使用什么以及有什么区别(部分,文章)
- 使用 jQuery 更改内部特定 Div 标签内的 TD 值
- 使用 jQuery 访问 TD 内部的 Div 标签
- 如何设置目标=“_空白“;在DIV标签中
- Div标签向下滚动
- jquery通过所有Div标签将文本更改为超链接
- 如何在新选项卡中打开DIV标签内的内容
- 在Div标签中加载带有选择列表的图像
- 在数据列表中切换Div标签
- 替换WKWebView中DIV标签的多行文本内容
- 动态地在Div标签上追加另一个Div数据
- Javascript动态追加DIV标签
- Div标签代码提取器