Sunday 15 May 2011

javascript - jquery this animate this element without id -


In my HTML code I have a div. Some warnings are included to users in this divisive warnings inside div elements with no ID Wrapped if the user clicks on the close button, then he should delete the warning div.

  & lt; Div id = "alarmbox" align = "center" & gt; & Lt; Div & gt; This warning 1 & lt; Button onclick = "remove_div_of_this_button (this);" & Gt; X & lt; / Button & gt; & Lt; / Div & gt; & Lt; Div & gt; This warning 2 & lt; Button onclick = "remove_div_of_this_button (this);" & Gt; X & lt; / Button & gt; & Lt; / Div & gt; & Lt; / Div & gt;   

And this is my JS code: Removing the function_dise_f_this_button (this button) {thisbutton.parentNode.parentNode.removeChild (thisbutton.parentNode); }

This works fine though, instead of removing an element, it is better to be animated if I only want to manipulate JS, how to remove the div with jquery is? Is it possible to identify thisbutton in jquery since $ (thisbutton) $?

Separate js from your html and use click events with jquery. Click here (function () {$ (this)

  $ (function () {$ ('# alabas button'). .clostest ('div'). Feeds (1000, function () {$ (this) .remove ();});});});   

or



No comments:

Post a Comment