A
A
Anto2017-09-26 09:07:07
1C-Bitrix
Anto, 2017-09-26 09:07:07

How to change photo on hover?

Good afternoon!
Tell.
There is a photo, displayed as usual in foreach, initially one announcement photo is displayed, you need to hover over the photo so that it changes to a detailed photo, and if there is no cursor, the announcement photo is returned.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Grabko, 2017-09-26
@ZIROKUL

See the news output component template. You need to display the value of two arrays of a detailed image and an announcement image. Something like:

<img src="<? echo($arItem["DETAIL_PICTURE"]["SRC"])" />

See the $arItem array
<pre>
<?
print_r($arItem);
?>
</pre>

Further, when we know both values ​​​​through hover, change the picture with styles

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question