• I have following code in my jQuery file:

    jQuery('.sf-menu > li > ul').parent().hover(
    	function() {
    		jQuery(this).prepend('<div class="arrow"><img src="wp-content/themes/chase_theme/images/superfish_arrow.png" />')
    		jQuery('.arrow').css({
    			height: '0px',
    			width: '7px',
    			margin: '0 auto 0',
    			position: 'relative',
    			top: '13px',
    			visibility: 'visible',
    		});
    
    	}, function() {
    		jQuery('.arrow img').delay(600).slideUp('normal');
    	}
    	);

    When I’m on my blog with following URL:

    https://www.blog-name.com/

    (Which is the start page.)
    Then the image will show up fine, but when I’m on:

    https://www.blog-name.com/blog/

    (Which is the page with the blog posts.)
    Then the image will not show up anymore, instead I will get the empty image frame (not found).

    So I’m wondering, since I cannot use TEMPLATEPATH and similar commands in a jQuery file, what would be the correct way setting a path in a jQuery file when using WordPress?

Viewing 1 replies (of 1 total)
  • Thread Starter chaseman

    (@chaseman)

    It works when I use an absolute path, but I’m wondering is that the only why to solve this problem?

Viewing 1 replies (of 1 total)
  • The topic ‘Correct Image Path in jQuery Files?’ is closed to new replies.