Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2008-04-20 19:59:48
- Ruhh
- Member
- From: dakota dunes
- Registered: 2008-01-20
- Posts: 305
open in new window
Is there a way to make the comment name that is linked to open in a new window?
<txp:Ruhh />
Offline
Re: open in new window
you could easily do this with jQuery… assuming the link is somewhere in a div that has a class comment
it would be:
<script type="text/javascript"> $(document).ready(function(){ $(".comment a").attr('target', '_blank'); }); </script>
Offline
#3 2008-04-20 21:42:05
- Ruhh
- Member
- From: dakota dunes
- Registered: 2008-01-20
- Posts: 305
Re: open in new window
Where would I put that snippet in?
<txp:Ruhh />
Offline
Re: open in new window
somewhere in your page template. don’t forget to load jQuery, there is already one included in textpattern which you could call that way:
<script type="text/javascript" src="<txp:site_url />textpattern/jquery.js"></script>
Offline
Re: open in new window
And call of jquery must me before your function, like this:
<script type="text/javascript" src="<txp:site_url />textpattern/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".comment a").attr('target', '_blank');
});
</script>
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
#6 2008-04-21 07:50:24
- Ruhh
- Member
- From: dakota dunes
- Registered: 2008-01-20
- Posts: 305
Re: open in new window
thanks! :)
<txp:Ruhh />
Offline
Pages: 1