开发者

jQuery toggle makes element show up behind element below it

开发者 https://www.devze.com 2023-03-20 07:21 出处:网络
I have a hidden element on my page. When a button is clicked, it makes the element below it slide down using slideToggl开发者_开发技巧e. The problem is that it is showing up behind the content that is

I have a hidden element on my page. When a button is clicked, it makes the element below it slide down using slideToggl开发者_开发技巧e. The problem is that it is showing up behind the content that is below it: http://jsfiddle.net/Messp/

I would like to make the toggled image to show in the front of the content. I tried using z-index but that does not work. Does anyone know how to fix this issue?


The image needs to be a positioned element for the z-index to take effect.

Throwing "position: relative;" on it should do the trick. :)

http://jsfiddle.net/Dygerati/DyPeC/1/embedded/result/


add a position:relative to the image, right after the z-index

0

精彩评论

暂无评论...
验证码 换一张
取 消