I am really trying to create a list of products inside a table. I already have php code that takes data from db and place on the page, but I'm stuck in jquery and javascript, I am such a noob. I read some docs and I came out with this script:
Javascript
$(window).load(function(){ $('.principale').hover(function() { $(this).animate({ width: 215, height: 350, margin: 0, }, 'fast'); $(this).animate().css('box-shadow', '0 0 5px #000') }, function() { $(this).animate().css('box-shadow', 'none') $(this).animate({ width: 210, height: 240, margin: 0, }, 'fast'); }); });
CSS
.tabellainizio { margin-top:100px; } .bordini { border: 1px #DDD solid; } .principale { height: 240px; width: 210px; overflow: hidden; } .principale .contenitore { height: 240px; width: 210px; float: left; display: block; } .immagine { border: 1px solid maroon; text-align: center; margin: 15px; height: 168px; width: 168px; position:relative; } .content { display: none; margin: 15px; } .contenitore:hover { width: 215px; height: 350px; margin: 0px; border: 1px solid black; } .contenitore:hover .content { display: block; } .contenitore:hover .immagine { position:relative; }
here you can see the demo: http://jsfiddle.net/fozzo/EWJGJ/
But this is not quite what I need. When a div expands, it should expand from the center above the others, which should instead remain in their positions. I think this is due to the use of z-index and position in css, as far as I read working examples, but I really don't understand how to make it work. Any help would be helpful.
Fabio source share