Saturday, 6 April 2013

Tuto : Auto Open New Tab

Assalamualaikum , Heyy guys ! Sihat ? Hmm dah lame jugak Ira tak post dalam blog ni . Kali ni Ira nak buatkan tuto "auto open new tab" . Nanti kalau korang tekan link kat dalam blog tu mesti dia pergi ke new tab . Cara dia senang jek .

  1. Dashboard > Layout > Add A Gadget > Html/JavaScript 
  2. Copy code bawah ni then paste kan kat dalam ruangan Html/JavaScript tu .
<!-- code for turning all non-blog links to new page links -->
<script type="text/javascript" language="javascript">
var arr = document.getElementsByTagName("a"); //get all links in the page
for(var i = 0; i < arr.length; i++)
{
if(arr[i].href.indexOf("Your URL") < 0 //not links that are 'inside' blog
&& arr[i].href.indexOf("javascript:") < 0) //not javascript links
arr[i].target = "_blank";
}
</script>
 Save .

# Pastikan korang copyy semua code ni tau ! Kalau tak , nanti tak jadi .

Selamat Mencuba ! ^_^

No comments:

Post a Comment

Assalamualaikum ! Tinggalkan komen korang :)

LinkWithin

Related Posts Plugin for WordPress, Blogger...