Modify css style for pseudo element :after content with Jquery

前端 未结 3 941
情深已故
情深已故 2020-12-07 20:51

I have baloon shape designed with CSS3.
JS Fiddle Example It\'s have triangle made with

:after {
    content: \"\";
}

I need to moving

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-07 21:31

    As per this related question, you can't select the pseudo element. So I'd suggest defining additional CSS classes, and adding classes to the balloon with jQuery. E.g. use a class like this:

    .pop.right:after {
        left: 80%;   
    }
    

    and apply it like this:

    $('div.pop').addClass('right');
    

    Working jsFiddle: http://jsfiddle.net/nrabinowitz/EUHAv/2/

提交回复
热议问题