S
S
Sergey2018-03-27 17:01:11
JavaScript
Sergey, 2018-03-27 17:01:11

How to alternately change the visibility of a div or change the src of an image?

There is a block with goods. When you hover over it, you need to change the pictures cyclically (5-10 pieces). How to implement it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stalker_RED, 2018-03-27
@Stalker_RED

Move some elements with pictures, or change their transparency, or change src, or take a ready-made slider. ( the first list of sliders that came across )

H
hardcorelite, 2018-03-27
@hardcorelite

$('#my_image').on({
    'click': function(){
        $('#my_image').attr('src','second.jpg');
    }
});

instead of clicking, you can also use mouseover and so on

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question