Blog post to open in a new window/tab

I would like to have my blog post open in a new window/tab. Is there a function existing already that I’ve not located yet? How can I achieve this?

Hi Kristy,
One way would be to use jQuery to add the “target” attribute to the links in the blog list as in this example:

$('ol.perc-blog-list a').attr('target', '_blank');

-Jon

Jon, where would this jQuery be placed inside percussion? Newbie here. Many apologies.

Hi Kristy, one method is to place snippets of jQuery in the code insertion points on your pages or templates. In your case, you could place the snippet in one of the code insertion points on your blog list template. I actually had to refactor the jQuery a little to account for any potential network delays:

<script> <br /> $(document).ready(function() { <br />
var count = 0; <br />
var addTarget = function(){ <br />
count++; <br />
 if($('ol.perc-blog-list li.perc-list-first')){ <br /> $('ol.perc-blog-list').find('.perc-blog-list-title, .perc-blog-list-comment-container').find('a').attr('target', '_blank'); <br />
         } <br />
  else if(count < 10) { <br />
      setTimeout(addTarget, 2000);
<br />
  } <br /> }; <br />
setTimeout(addTarget,500); <br /> }); <br /> </script>