Showing posts with label JQuery. Show all posts
Showing posts with label JQuery. Show all posts

Thursday, 10 March 2016

JQuery tool tip for text box text

please download and add below files into solution
Jquery-ui.css
Jquery-UI.js
Jquery.min.js

add reference to your page and add below code into your page for getting tooltip


<script type="text/javascript">

             //Initial bind
             $(document).ready(function () {


                 BindControlEvents();
             });

             function BindControlEvents() {

            //changing attribute title to Value
                 $('img').each(function () {
                     var $t = $(this);
                     $t.attr({
                         Value: $t.attr('title')
                     }).removeAttr('title');
                 });


                 $('input[type=text]').tooltip(); //binding tooltip to text box
                 $('img').tooltip(); //binding tooltip to Image

             }


             //Re-bind for callbacks
             var prm = Sys.WebForms.PageRequestManager.getInstance();

             prm.add_endRequest(function () {
                 BindControlEvents();
             });

    </script>

Calling Javascript/Jquery on callbacks

JavaScript or JQuery some methods won't work in callback if you are using below it will work

<script type="text/javascript">

             //Initial bind
             $(document).ready(function () {


                 BindControlEvents();
             });

             function BindControlEvents() {

                ////your code here

             }


             //Re-bind for callbacks
             var prm = Sys.WebForms.PageRequestManager.getInstance();

             prm.add_endRequest(function () {
                 BindControlEvents();
             });

    </script>