jquery工具:工具提示和标签不能一起播放

时间:2009-09-28 08:19:20

标签: javascript jquery html cakephp

我正在使用jquery工具。 我试图将工具提示放在选项卡中的表单的输入上。 这是我的剧本:

<script>
// perform JavaScript after the document is scriptable. 
$(function() {
// initialize tooltips 
$("#UserContactPerson").tooltip({ 

    // place tooltip on the right edge 
    position: "center right", 

    // a little tweaking of the position 
    offset: [-140, -15], 

    // use the build-in fadeIn/fadeOut effect 
    effect: "fade", 

    // custom opacity setting 
    opacity: 0.7, 

    // use this single tooltip element 
    tip: '.tooltip'});
});

$(function() { 
    // setup ul.tabs to work as tabs for each div directly under div.panes 
    $("ul.tabs").tabs("div.a"); 
});
</script>

这是cakephp中的php

<div class="a">
    <?php 

echo $form->create('User', array('action' => 'recover'));
echo $form->input('contact_person', 
                  array('title' => 'who is responsible for the account'));
echo "<label></label>".$form->submit('Submit', array('name'=>'Submit'));
echo $form->end();

    ?>        

</div>

代码适用于不在标签中的不同形式。

感谢您的提示。

1 个答案:

答案 0 :(得分:0)

对这两个插件一无所知我猜你想要交换你应用它们的顺序。首先选中它,然后设置工具提示,看看是否更好。

此外,您不需要两个$(文档)函数,只需将它们粘在一起就像这样:

<script>
  // perform JavaScript after the document is scriptable. 
  $(function() {      
    // setup ul.tabs to work as tabs for each div directly under div.panes 
    $("ul.tabs").tabs("div.a"); 

    // initialize tooltips 
    $("#UserContactPerson").tooltip({ 

      // place tooltip on the right edge 
      position: "center right", 

      // a little tweaking of the position 
      offset: [-140, -15], 

      // use the build-in fadeIn/fadeOut effect 
      effect: "fade", 

      // custom opacity setting 
      opacity: 0.7, 

      // use this single tooltip element 
      tip: '.tooltip'
    });    
  });
</script>
相关问题