referencing my site path in jquery
-
Hi
I think this is going to be very simple for someone but I can’t seem to get to grips with it.
I have a script (don’t comment on the code I am struggling as it is!)‘$j=jQuery.noConflict();
$j(document).ready(function(){var mylogoimage = jQuery(“#logoid”).attr(‘src’);
var templateUrl = (“https://pitchandco.com/staging/wp-content/themes/pitchandco”);jQuery(“.menu li.page-item-17 a”).hover(function(){
jQuery(“#logoid”).attr(‘src’, templateUrl+”/images/global/logo/about.gif”);
});jQuery(“.menu li.page-item-17 a”).mouseleave(function(){
jQuery(“#logoid”).attr(‘src’, mylogoimage);
});});’
var templateUrl as you can see is hard coded for now. How do I dynamically reference this
‘<?php bloginfo(‘template_directory’); ?>’
I can’t seem to get the syntax right to call this in my query.
so when the site changes from staging to live this automatically updated too …..I know this should be easy I’m just not a coder.
Many Many Thanks for any help
helen
- The topic ‘referencing my site path in jquery’ is closed to new replies.