Making a div expand with jQuery without moving divs floating to it

前端 未结 4 681
执念已碎
执念已碎 2021-01-16 00:24

I\'m trying to get an effect similar to what you can find at http://www.nokiausa.com/us-en/products/ with a grid of basic information, where a click expands information over

4条回答
  •  囚心锁ツ
    2021-01-16 00:55

    Just taking a quick stab at this, I would suggest that before animating, add a z-index property to the element that you wish to enlarge. This should make it go above the neighboring element and hide it instead of pushing it down.

    Something like:

    
    function growRight(){
            $("#stuff1").css("z-index","5");
            $('#stuff1').animate({
                backgroundColor: "#FF8600"
            }, 750 );
            $('#stuff1').animate({
                width: "510px"
            }, 750, function() {});
        }
    

提交回复
热议问题