• Recent Questions
  • Popular Questions

jQuery. How to get attribute back?

I removed from div -> $(‘#actionDivR’).removeAttr( “onmouseup”); AND I want to know how to return this attribute back.

I need Enadle/Disable functionality of DIV.
###############################
First off,
###############################
I need to disable reaction on mouseup while javascript processing data AND get it back when javascript finishes processing data. I need This DIV visible at every time, but need reaction on event only when JavaScript isn’t running.
PS. I don’t want to interrupt javascript while it is processing data.

    no1home2day
    Posted 10 months ago

    I THINK I’m understanding your question. If so, this MIGHT be what you’re looking for; if not, sorry :-(

    In jQuery, everything can be summed up in two steps: Get something, do something with it.

    In the CSS, you would have something already there, then in the jQuery, you would add the class, or even toggle it.

    Here’s an example:

    CSS:
    .big {
    … font-size: 400%;
    … width: 500px;
    … height: 500px;
    … line-height: 100%;
    }

    jQuery:
    $(document).ready(function(){
    … $(‘#animate’).click(function(){
    … … $(‘.box’).toggleClass(‘big’, 2000);… … // 2000 is the time delay
    … }) ;
    })

    You could also use .addClass.

    (Note the series of dots (… ) is actually spaces, because if I used actual spaces, yahoo would remove them.)

    I HOPE this is what you’re looking for. Good luck, and “happy programming”. :-)

Answer this Question :

You must be logged in to post an answer. Signup Here, it takes 5 seconds :)

Other Questions