开发者

Jquery thorws error on post back when finding .dynamic function

开发者 https://www.devze.com 2023-03-28 05:16 出处:网络
i am using jquery to show a tooltip popup the code i am using is below <script type=\"text/javascript\">

i am using jquery to show a tooltip popup the code i am using is below

     <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>

but when i load my page i get this error

TypeError: $(".download_now").tooltip({effect: "slide", delay: 300}).dynamic is not a function

I have no clue why this is happening. anyone got any idea or solutino...

Regards


Check the order you import your script in. Make sure this script tag is below the jquery-tooltip plugins import. Also make sure jquery and jquery-ui are imported above the jquery-tooltip plugins. Also you may want to try wrapping this code with document.ready() to make sure all script is loaded like:

<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>

To make sure you have the proper libraries you could also try swapping the jquery import and the jquery tools import with this import that contains jquery + jquery tools + dynamic plugin:

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

Also try:

 $(".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 } });
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号