How to “fadeOut” & “remove” a div in jQuery?

后端 未结 7 1451
醉酒成梦
醉酒成梦 2020-12-12 09:43

I\'m trying to give fadeout effect to a div & delete that div(id = \"notification\"), when an image is clicked.

This is how I\'m doing that:

<         


        
7条回答
  •  既然无缘
    2020-12-12 09:55

    Try this:

    
    

    I think your double quotes around the onclick were making it not work. :)

    EDIT: As pointed out below, inline javascript is evil and you should probably take this out of the onclick and move it to jQuery's click() event handler. That is how the cool kids are doing it nowadays.

提交回复
热议问题