wp/wp-content/plugins/codecanyon-3027163-content-timeline-responsive-wordpress-plugin/js/frontend/rollover.js
author ymh <ymh.work@gmail.com>
Wed, 06 Nov 2013 03:21:17 +0000
changeset 0 d970ebf37754
permissions -rwxr-xr-x
first import
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
(function($){
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
$(document).ready(function() {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
	timelineImage();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
});
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
			
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
function timelineImage(){
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
	
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
	$('.timeline_rollover_top').unbind('hover').timelineRollover('top');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
	$('.timeline_rollover_right').unbind('hover').timelineRollover('right');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
	$('.timeline_rollover_bottom').unbind('hover').timelineRollover('bottom');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
	$('.timeline_rollover_left').unbind('hover').timelineRollover('left');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
	
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
$.fn.timelineRollover = function(type) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
	var lstart,lend;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
	var tstart,tend;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
	
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
	$(this).append('\n<div class="image_roll_glass"></div><div class="image_roll_zoom"></div>');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
	
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
	
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
	switch (type)
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
	{
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
		case 'top' : lstart='0'; lend='0'; tstart='-100%'; tend='0'; break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
		case 'right' : lstart='100%'; lend='0'; tstart='0'; tend='0'; break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
		case 'bottom' : lstart='0'; lend='0'; tstart='100%'; tend='0'; break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
		case 'left' : lstart='-100%'; lend='0'; tstart='0'; tend='0'; break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    29
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
	$(this).find('.image_roll_zoom').css({left:lstart, top:tstart});
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
	$(this).hover(function(){
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
		$(this).find('.image_roll_zoom').stop(true, true).animate({left: lend, top:tend},200);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
		$(this).find('.image_roll_glass').stop(true, true).fadeIn(200);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
},function() {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
		$(this).find('.image_roll_zoom').stop(true).animate({left:lstart, top:tstart},200);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    36
		$(this).find('.image_roll_glass').stop(true, true).fadeOut(200);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
	});
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
	
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
} 
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    41
})(jQuery);