javascript - Ajax CSS bugg. How do i prevent from double click in order for the css to apply? -


I have a div that says "on",

and I have created an Ajax function Every time a user clicks on the div, it will convert "On" to "off" (User ID must be echoed out on a query if the Divi ID is turned on or off) and if the user clicks again It will be switched to "On" again. (Like ".2 button") (function () {var d = $ (this) .attr ("id"); if (d = "shutdown") {$ (". Button 2"). ("Id-level", "0 -30px"); $ ("button."). At ("id", "on");} and atr ("id", "off", "atr" "ATR", "ATR");}}); });

My problem is that, to work the function, I have to click the div2 twice what is the problem?

But this is a switch button depending on the user present on that column. If the user has online = 1 for example, then he should start switching in the opposite direction. Off & G; On, on & gt; OF DIV is based on a query

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -