Aman Singh
Aman Singh

Reputation: 17

How can change style element on page

If I have below style and I want to change it on click Event

           .amet:before,
            .amet:after,
            .amet .side > div,
            .amet .corner > div {
                position: absolute;
                background-image: url();
            }

Some one plz suggest me. What shuld I do.

Upvotes: 0

Views: 37

Answers (2)

Lajon
Lajon

Reputation: 321

$(obj).click(function(){
    $(".amet").css({
          your style here
    });
    $(".amet .corner > div").css({
         backgroundImage: url,
         position: "static"
    });
});

Upvotes: 2

user5456506
user5456506

Reputation:

step 1: put your style into a div ()
step 2: send ajax request on click event.
step 3: create required style on Controller and send it back on page.
step 4: empty your div and replace with html return by ajax success( $('.style-change').empty(); $('.style-change').html(html); )

Upvotes: 1

Related Questions