Dynamically swap image on div mouseover
-
I want to swap my image’s src when the parent div is moused over. I’ve registered some wordpress fields for this purpose. But only if the mouseover image is present.
Right now I am using
<img src="<?php get_field('home_image'); ?>" />
I want to swap the src for
get_field('hovered_image')
whenever anyone mouses over the containing divparent
, but only ifhovered_image
is used in my post.<div class="parent"> <div class="ignore"> <img src="<?php get_field('home_image'); ?> <div class="text"> <h3><?php the_title(); ?></h3> </div> </div> </div>
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Dynamically swap image on div mouseover’ is closed to new replies.