current position:Home>JQuery realizes picture switching

JQuery realizes picture switching

2022-04-29 13:33:12Dada front end

            <img class="imgclick" src="img/pic1.png" />

  $(this).attr("src", "img/pic1.png");
  }, function() {
   $(this).attr("src", "img/pic2.png");
  }).attr("src", "img/pic1.png");

You can also use the background , Switch between two class. In this way, there is no need to bother the backend to modify js Picture path in .

utilize toggle Switch between different functions

copyright notice
author[Dada front end],Please bring the original link to reprint, thank you.

Random recommended