How to open Webpage menu in new page
Normally we click in the menu of our web it opens in the same page so it disturbs our home page and makes the customer to go back and resign our page. If it is open in new page then still our main web is open and visitor again can come back and view our web
Let's do below 2 Methods to do it in a simple way
1. Just go to your theme and click on edit HTML and paste below-given code above the </head> tab, to find </head> tag just find it from Ctrl+F in your theme HTML view
<script type='text/javascript'>
$(document).ready(function() {
$("a[href^='http://']").each(
function(){
if(this.href.indexOf(location.hostname) == -1) {
$(this).attr('target', '_blank');
}
}
);
$("a[href^='https://']").each(
function(){
if(this.href.indexOf(location.hostname) == -1) {
$(this).attr('target', '_blank');
}
}
);
});
</script>
2. Just Paste Blow to code just above the </body>
<script>
//<![CDATA[
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
//]]>
</script>
No comments:
Post a Comment