im Trying to animate positioned fixed before selector with jQuery. how can we call and animate :before selector in jQuery i know other method by calling class etc.. But i only want to be done it with jQuery.
html
<div id="main"></div>
css
#main {
width:200px;
height:300px;
background:#000;
}
#main:before {
content:'im before';
position:fixed;
left:0px;
top:0px;
width:40px;
height:40px;
background:blue
}
js
$("#main").hover(function () {
$(this).animate({
"margin-left": "40px"
});
$("#main:before").animate({
"margin-left": "40px"
});
}, function () {
$(this).animate({
"margin-left": "0px"
});
$("#main:before").animate({
"margin-left": "0px"
});
});
Note: please give me some solution without any plugin