$('.menu div.profile-btn').on('click', function () {
$('.mainservice-page').fadeIn(1200);
}
The above script opens the contents of the div .mainservice-page
successfully, but I want to open them in a new tab.
How can I do that?
Thanks in advance.
You can do like that :
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();
});
Hope this will help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With