6 July 2011

Tuto : Open New Tab When Cursor Click the link

Photobucket

Comel tak kucing Kihah? 

Hye. Hari ni, Kihah nak buat tuto Open New Tab When Cursor Click the link. Paham tak? 
Tutorial ni, Bila cursor tekan link, Automatik, dia buka New Tab. :D 
So, kepada sesiapa yang blog dia tu tak boleh right click, Boleh la guna tuto ini :D

1. DAshbord > Design > Add A Gadget > HTML JavaScript
2. Copy [CTRL+C serentak] kod kat bawah ni, dan pastekan [CTRL+V serentak] di dalam ruangan HTML/JavaScript tadi 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>
3. Save. ◕‿◕ 

Ok. Sekarang, korang tekan la link-link kat blog karang tu. Theee :D Wa'alaikumussalam ◕‿◕ 

2 comments:

Your words defines you