29.7.12

Open Link in New tab.

Open link in new tab is one of the most used feature by all. This template makes it still more easier. This template has included a jquerry code. By default the template will open links other than the blog's URL links in new tab even though you did not select "open link in new tab"
You can choose what all URLs' to exclude. It needs template Editing:-
Go to HTML Template Editor.
  • Press Ctrl + F and find </body>
  • Above it, you could see a code like this :-
    jQuery(function($){
        $(&#39;a[href^=&quot;http://&quot;]&#39;)
    .not(&#39;[href*=&quot;<data:blog.url/>&quot;]&#39;)
    .not(&#39;[href*=&quot;<data:blog.homepageUrl/>&quot;]&#39;)
            .attr(&#39;target&#39;,&#39;_blank&#39;);
    });
  • In the above code, to prevent a URL from opening in new tab, for example, howtoblog.krishnainfotron.com, Just add,
    .not(&#39;[href*=&quot;howtoblog.krishnainfotron.com&quot;]&#39;)
    to the next line of
    .not(&#39;[href*=&quot;<data:blog.homepageUrl/>&quot;]&#39;)

  • Save Template.
Note:- When you add links, make sure that "Open Link in new tab" is un checked always.

0

Post a Comment