eristoddle
11/28/2012 - 8:17 PM

IE7 and IE 8 Custom Button tag fix

IE7 and IE 8 Custom Button tag fix

(function($){
	$.fn.ieButtonFix = function(){
		return this.each(function(i, obj){
			var $this = $(obj)
				$parentAnchor = $this.parent()
				parentLink = $parentAnchor.attr('href');
			
			$($parentAnchor).click(function(){
				window.open(parentLink);
			});

		});
	}
})(jQuery);

(function($) { 
  Drupal.behaviors.realbusiness = {
    attach: function (context, settings) {
    	$('a[target="_blank"] button').ieButtonFix();
    }
  };
})(jQuery);