embed php in javascript to switch out image
-
I am trying to embed a some php in my javascript to switch out images…
$(document).ready(function() { $('.small-port-images a:nth-child(3)').click(function() { $('.large-port-image img').attr('src', '<?php echo get_stylesheet_directory_uri() ?>/images/large-brigham.jpg'); }); });I am not sure if I am approaching this correctly. Any advice?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘embed php in javascript to switch out image’ is closed to new replies.