Answer the question
In order to leave comments, you need to log in
Change inline styles dynamically on hover over container?
Hello.
There is a container with elements, you need to update the inline styles for the elements when hovering over it.
section.about-fs(@mousemove="")
div.about-rhombuse__item.about-rhombuse__anim(
v-for="(anim, index) in 5"
:class="'about-rhombuse__anim_' + (index + 1)"
:style=""
)
div.content-wrap
div.about-rhombuse__item.about-rhombuse__anim(
v-for="(anim, index) in 5"
:class="'about-rhombuse__anim_' + (index + 6)"
:style=""
)
Answer the question
In order to leave comments, you need to log in
own:
section.about-fs(@mousemove="rhombAnim")
div.about-rhombuse__item.about-rhombuse__anim(
v-for="(anim, index) in 5"
:class="'about-rhombuse__anim_' + (index + 1)"
:style="rhombValue"
)
div.content-wrap
div.about-rhombuse__item.about-rhombuse__anim(
v-for="(anim, index) in 5"
:class="'about-rhombuse__anim_' + (index + 6)"
:style="rhombValue"
)
data() {
return {
rhombValue: {}
}
},
methods: {
rhombAnim(e) {
const pageX = e.clientX,
pageY = e.clientY
this.rhombValue = {
transform: "rotate(90deg) translateX(" + pageX/60 + "%) translateY(" + pageY/45 + "%)"
}
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question