Good day to all.
There is such a script:
It is necessary to make a change of pictures by clicking. I found an example on the net and wrote code on it. It does not work for me and displays an error in the console. Please tell me how can I fix the code? For a better understanding I will explain - .slide-225 is my class of pictures, and src are the paths of the images that I am trying to replace. I will be glad to any comment and advice :)
$(".slide-225").bind("click", function() { var src = ($(this).attr('src="/wp-content/uploads/2017/01/Mirdif-2-960x640.jpg"') === "Mirdif-2-960x640.jpg") ? "Mirdif-full-960x640.jpg" : "Mirdif-2-960x640.jpg"; $(this).attr('src="/wp-content/uploads/2017/01/Mirdif-2-960x640.jpg"', src); });