Domanda

I am developing a web app in sencha touch. I need to dynamically change the style for one of the class with psuedo element.

Below is my element in the css file..

.testdiv::before{
    margin-left: -0.4em;
    margin-top: -0.10em;
 }

I need to change the margin-top values dynamically in the code as the style needs to be changed in different screens.

I tried

Ext.select(".testdiv").setStyle('margin-top','1em').

But this doesn't apply style to the psuedo element ": before".. How can I do this ?

È stato utile?

Soluzione

this is not possible even in jQuery, but I found a solution here: link

you need to add an extra class to your testdiv elements, e.g. on and add a css rule:

.testdiv.on:before {
    margin-top: 1em;
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top