Change jQuery(document).ready to $.delegate in wordpress
<p>I am trying to change:</p>

<pre><code>add_action('wp_footer','myscript_in_footer');
function myscript_in_footer(){
?&gt;
&lt;script type="text/javascript"&gt;
  jQuery(document).ready(function(){
   jQuery("div.domTip_tipBody").mouseover(function(){
   jQuery("#yyy a.tippy_link").css("background-color","yellow");});  

   jQuery("div.domTip_tipBody").mouseout(function(){
   jQuery("#yyy a.tippy_link").css("background-color","red");
 }); 
 });  
 &lt;/script&gt;
&lt;?php
}
</code></pre>

<p>To</p>

<pre><code>add_action('wp_footer','myscript_in_footer');
function myscript_in_footer(){
?&gt;
&lt;script type="text/javascript"&gt;
  function(){
    $.delegate('p','mouseover', function(e){ 
    jQuery("#yyy a.tippy_link").css("background-color","yellow");}); 

   $.delegate('p','mouseout', function(e){
    jQuery("#yyy a.tippy_link").css("background-color","red");
 }); 
 });  
 &lt;/script&gt;
&lt;?php
}
</code></pre>

<p>The first one works but the second one dose not.</p>

<p>The reason for the change is that I have elements that are output by a shortcode (e.g "div.domTip_tipBody") that the first function is not reading and it was suggested that the second method might work, but I can not get the second method functioning even with the element 'p'.</p>

<p>Thanks
Tim</p>
