0

Is ti possible to set the below css using jquery ??

like .addClass() in jquery

.macbook:not(:hover) .macbook-lid {
  -webkit-transform: rotate3d(-1, 0, 0, 91deg);
  -moz-transform: rotate3d(-1, 0, 0, 91deg);
  transform: rotate3d(-1, 0, 0, 91deg);
}
.macbook:not(:hover) .macbook-lid:before {
  width: 94%;
}
1
  • what are you trying to do....do you want to add a hover effect using jQery? Commented Nov 1, 2013 at 7:24

2 Answers 2

1

Try this,

CSS

.macbook:not(:hover) .macbook-lid {  }
.test{
  -webkit-transform: rotate3d(-1, 0, 0, 91deg);
  -moz-transform: rotate3d(-1, 0, 0, 91deg);
  transform: rotate3d(-1, 0, 0, 91deg);
}
.macbook:not(:hover) .macbook-lid:before {
  width: 94%;
}

SCRIPT

$('.macbook').on('click',function(){
    $('.macbook-lid').toggleClass('test');
});

Tried to create a Demo

Sign up to request clarification or add additional context in comments.

Comments

0

Is ti possible to set the below css using jquery ??

Yes.

JS:

$('.element').hover(function() {
$(this).addClass('class-below');
}, function {
$(this).removeClass('class-below');
});

CSS :

.class-below:before { .... }

You will use this class to add below logic.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.