CTR Enhancer JS - 广告增强效果工具

CTR Enhancer JS - 广告增强效果工具1415
提高广告的点击率200%这个简单但有效的脚本。
  顶栏颜色
  顶栏字体颜色
  顶栏字体
  面具颜色
  面具不透明
  垂直偏移量
  横向偏移量
//set the mask offset
	var dc_ce_vertical_offset = 0;
	var dc_ce_horizontal_offset = 0;

	//add the masks and the message just before the closed body tag
	var mask_and_message = '<div id="dc-ce-mask-1" class="dc-ce-mask" ></div>';
	var mask_and_message = mask_and_message + '<div id="dc-ce-mask-2" class="dc-ce-mask" ></div>';
	var mask_and_message = mask_and_message + '<div id="dc-ce-mask-3" class="dc-ce-mask" ></div>';
	var mask_and_message = mask_and_message + '<div id="dc-ce-mask-4" class="dc-ce-mask" ></div>';
	var mask_and_message = mask_and_message + '<div id="dc-ce-message-container" ><div id="dc-ce-message"></div></div>';
	
	$('body').append(mask_and_message);
	
	//handle the hover behavior on the adv
	$('.ctr-enhancer').hover( function(){
		
		//Hover Handler In
		
		//show the top bar
		dc_ce_show_bar( this );
		
		//show and hide the mask
		dc_ce_show_mask( this );
		
	}, function(){
	
		//Hover Handler Out
		
		//hide the masks
		$('.dc-ce-mask').hide();
		
		//hide the message
		$('#dc-ce-message-container').hide();
		
	});
	
	//functions --------------------------------------------------------------------------
	
	function dc_ce_show_mask( element ){

		var adv_width = $(element).width();
		var adv_height = $(element).height();
		var document_width = $(document).width();
		var document_height = $(document).height();
		
		var offset_top = $(element).offset().top + dc_ce_vertical_offset;
		var offset_left = $(element).offset().left + dc_ce_horizontal_offset;
		var offset_bottom = document_height - offset_top - adv_height;
		var offset_right = document_width - offset_left - adv_width;

		//set mask 1 position - top mask
		$('#dc-ce-mask-1').css('top', '0' );
		$('#dc-ce-mask-1').css('left', '0' );
		$('#dc-ce-mask-1').css('height', offset_top + 'px' );
		$('#dc-ce-mask-1').css('width', document_width + 'px' );
		
		//set mask 2 position - left mask
		$('#dc-ce-mask-2').css('top', offset_top + 'px' );
		$('#dc-ce-mask-2').css('left', '0' );
		$('#dc-ce-mask-2').css('height', adv_height + 'px' );
		$('#dc-ce-mask-2').css('width', offset_left + 'px' );

		//set mask 3 position - bottom mask
		$('#dc-ce-mask-3').css('top', offset_top + adv_height + 'px' );
		$('#dc-ce-mask-3').css('left', '0' );
		$('#dc-ce-mask-3').css('height', offset_bottom + 'px' );
		$('#dc-ce-mask-3').css('width', document_width + 'px' );
		
		//set mask 4 position - right mask
		$('#dc-ce-mask-4').css('top', offset_top );
		$('#dc-ce-mask-4').css('left', offset_left + adv_width + 'px' );
		$('#dc-ce-mask-4').css('height', adv_height + 'px' );
		$('#dc-ce-mask-4').css('width', offset_right + 'px' );
		
		//display the mask
		$('.dc-ce-mask').show();
		
	}
	
	function dc_ce_show_bar( element ){
		
		//check if ctr-message is available
		if( $(element).find(':first-child').hasClass('ctr-message') ){
			
			//move the message from the placeholder to the real message div
			var message = $(element).find(':first-child').html();
			$('#dc-ce-message').html(message);
		
			//display the top bar only if the top bar doesn't overlap the hovered advertising
	  		var window_offset_top = $(element).offset().top - $(window).scrollTop();
	  		if( window_offset_top > parseInt( $('#dc-ce-message-container').css('height'), 10 ) ){			
				//display the bar
				$('#dc-ce-message-container').show();
			}		
		
		}		
		
	}

也许你还喜欢