Hi guys! do you know how can i make my photo jump to the front when I am with the mouse on the photo? Normally i want to have the text in front but just when im moving my mouse on photo i want next photo ( me with out the background) jump in front of
give your slide__image-wrapper element position relative to be able to change its z-index then use custom code to change z-index to let’s say 100 on mouseover. If you would like to have this effect also on mobile devices you should use pointer events instead.
Another thing is that your interaction is in the slider. This means you may have more than one slide__image--wrapper(one in each slide). so you have a few options but I do not have enough information to give you a correct answer.
OPTIONS:
if you would like to have this image interaction only on one slide you should give your wrapper id and select an element based on this id.
if you would like to have this interaction on all slides you need to create an Array of all image wrappers and add this interaction to each of these wrappers.
Here is a very simple example for opt.2
// create an array
const imgWrappers = Array.from(document.querySelectorAll(".slide__image--wrapper"))
// Add listeners to each image wrapper
imgWrappers.forEach( item => {
item.addEventListener("mouseover", zUp)
item.addEventListener("mouseout", zBack)
}
)
function zUp(){
// do stuff
}
function zBack(){
// do stuff"
}