2013-02-05 45 views

回答

0

這是我編附加說明暈倒標籤(添加爲節點說明):

<script type="text/javascript"> 
    $(document).ready(function(){ 
     $(".form-item:has(div.description)").children("label").append(function(){ 
      $(this).parent().children('.description').hide(); 
      return '<sup><a href="#" onclick="$(this).parent().parent().parent().find(\'.description\').toggle();" title="'+$(this).parent().children('.description').text()+'"><strong>?</strong></a></sup>'; 
     }); 
    }); 
</script> 

沙盒的位置:http://jsfiddle.net/eapo/3ubec/

任何其他建議?

+0

如果您使用的是drupal 7,您應該使用drupal行爲而不是document.ready – 2pha

+0

謝謝,它在本文中是drupal 6。 – eapo