Как изменить фон изображения при наведении курсора на аккордеон? - PullRequest
0 голосов
/ 10 мая 2019

Я хочу изменить изображение рядом с аккордеоном при переключении / нажатии на элементы аккордеона.Извините, я не могу предоставить код, потому что я просто не знаю, с чего начать ... Заранее спасибо!Мой сайт: https://aviel -albo.com / services / Сайт на иврите, если вы спросите себя:)

1 Ответ

1 голос
/ 10 мая 2019

<html>
<body>

<img onmouseover="otherImg(this)" onmouseout="normalImg(this)" border="0" src="https://cdn.shortpixel.ai/client/q_glossy,ret_img/https://aviel-albo.com/wp-content/uploads/elementor/thumbs/jordan-whitt-145327-unsplash-min-o7d1qu5enzt7olvmxk54flz05g93601jl1mzty5e78.jpg" width="132" height="132">

<p>The function otherImg() is triggered when the user moves the mouse pointer over the image.</p>
<p>The function normalImg() is triggered when the mouse pointer is moved out of the image.</p>

<script>
function otherImg(x) {
  x.src = "https://www.w3schools.com/jsref/smiley.gif";
 
}

function normalImg(x) {
  x.src = "https://cdn.shortpixel.ai/client/q_glossy,ret_img/https://aviel-albo.com/wp-content/uploads/elementor/thumbs/jordan-whitt-145327-unsplash-min-o7d1qu5enzt7olvmxk54flz05g93601jl1mzty5e78.jpg";
  
}
</script>

</body>
</html>
...