Jump to content

enlarge div on rollover


1internet

Recommended Posts

I have been trying to create a rollover effect that enlarges a div in the results page. Identical to the old google image results, when you rollover an image it would enlarge.

I am currently doing this through jquery animate

$('.product_result').hover(function(){
	$(this).css('position', 'relative')
	$(this).animate({ 
		'width': '220px',
		'height': '286px',
		'margin-left': '-6px',
		'margin-top': '-6px'
		}, 'fast');
	},function(){
	$(this).animate({
		'width': '200px',
		'height': '260px',
		'margin-left': '6px',
		'margin-top': '6px'
		}, 'fast');
});

The problem is with this code is that it distorts the position of all other elements I want it to do the equivalent effect of being position absolute, when the height and width are increased, as to not affect layouts.

Link to comment
https://forums.phpfreaks.com/topic/277602-enlarge-div-on-rollover/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.