Wednesday, November 23, 2011

How to open the Primary Liks or Secondary Links in New Tab

How to open the Primary Liks or Secondary Links in New Tab:

Give this code inside your template.php file,
For Example,your primary menu item class is menu-1 and its locate inside a <li class="menu1"><a href="<?php $base_path();?>contact_us"></a></li> tag then,
you should do like this,

drupal_add_js ('$(document).ready(function(){$("li.menu-1 a").click(function() {     window.open(this.href); return false; }    ); 
}

No comments:

Post a Comment