I am trying to create a dynamic image swap with jquery. My image src is in a custom field in a related entry. For each image I have a title_image_file (default state) and a title_image_file_mo (hover state). (I’m not sure if this is relevant, but the image entry is associated with the current entry via a related_entry). The problem is the EE tags within my jquery aren’t being parsed.
My jquery:
$('img.title').hover(function(){
$(this).attr("src","{title_image_file_mo}");
},function(){
$(this).attr("src","{title_image_file}");
});
My HTML:
{exp:weblog:entries weblog="default_site" dynamic="off" orderby="custom_sort" sort="asc" search:page_no="p1" category="{cat_id}"}
<li><a href="http://{path=h1/product/{entry_id}}">_ {related_entries id="title_image"}_ {title_image_file}_ {/related_entries}</a></li>
{/exp:weblog:entries}The jQuery *is* working because when I hover over the image it is replaced by a broken image link (i.e., the contents of the alt tag).
Help!?!