0

jqueryを使用してツールチップポップアップを表示しています使用しているコードは以下のとおりです

     <script type="text/javascript">
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(MainEndRequestHandler);

            $(MainEndRequestHandler);

            function MainEndRequestHandler(sender, args) {
                loadeverthingmaster();
            }

            function loadeverthingmaster(){
                 try
                 {  

                          $(".download_now").tooltip({ 
                              effect: 'slide',
                              delay:300                                                               

                          }).dynamic({ bottom: { direction: 'down', bounce: true } });          


                       $(".help-bubble-link[title]").tooltip({

                          // tweak the position
                          offset: [10, 2],

                          // use the "slide" effect
                          effect: 'slide',

                          // add dynamic plugin with optional configuration for bottom edge
                       }).dynamic({ bottom: { direction: 'down', bounce: true } });

                 }
                 catch(err)
                 {
                     alert(err);
                 } 
            }

        </script>

しかし、ページをロードすると、このエラーが発生します

TypeError:$( "。download_now")。tooltip({effect: "slide"、delay:300})。dynamicは関数ではありません

なぜこれが起こっているのか私にはわかりません。誰もがアイデアや解決策を思いついた...

よろしく

4

1 に答える 1

0

スクリプトをインポートする順序を確認してください。このスクリプト タグが jquery-tooltip プラグイン インポートの下にあることを確認してください。また、jquery と jquery-ui が jquery-tooltip プラグインの上にインポートされていることを確認してください。また、このコードを document.read() でラップして、すべてのスクリプトが次のように読み込まれるようにすることもできます。

<script type="text/javascript">
$(document).ready(function(){
       Sys.WebForms.PageRequestManager.getInstance().add_endRequest(MainEndRequestHandler);

            $(MainEndRequestHandler);

            function MainEndRequestHandler(sender, args) {
                loadeverthingmaster();
            }

            function loadeverthingmaster(){
                 try
                 {  

                          $(".download_now").tooltip({ 
                              effect: 'slide',
                              delay:300                                                               

                          }).dynamic({ bottom: { direction: 'down', bounce: true } });          


                       $(".help-bubble-link[title]").tooltip({

                          // tweak the position
                          offset: [10, 2],

                          // use the "slide" effect
                          effect: 'slide',

                          // add dynamic plugin with optional configuration for bottom edge
                       }).dynamic({ bottom: { direction: 'down', bounce: true } });

                 }
                 catch(err)
                 {
                     alert(err);
                 } 
            }
});
        </script>

適切なライブラリがあることを確認するために、jquery インポートと jquery ツール インポートを、jquery + jquery ツール + 動的プラグインを含むこのインポートと交換することもできます。

<!-- jQuery Library + ALL jQuery Tools -->
<script src="http://cdn.jquerytools.org/1.2.5/full/jquery.tools.min.js"></script>

また試してください:

 $(".help-bubble-link['title']").tooltip({  //notice change in this line

                          // tweak the position
                          offset: [10, 2],

                          // use the "slide" effect
                          effect: 'slide',

                          // add dynamic plugin with optional configuration for bottom edge
                       }).dynamic({ bottom: { direction: 'down', bounce: true } });
于 2011-08-12T14:26:30.320 に答える