0

thanks in advance for all support. I started to learn writing a jQuery plugin. Progressbar from JQuery UI is in use. But I never see a progressbar.

startProgressBar.jquery.plugin.js:

(function($){
  $.widget( "nmk.progressbar", {
    _create: function() {
        var progress = this.options.value + "%";
        this.element.addClass( "progressbar" ).text( progress );
    }
 });
})(jQuery);

progressbar.html

<!doctype html>
<html lang = "en">
   <head>
      <meta charset = "utf-8">
      <title>jQuery UI ProgressBar functionality</title>
      <link href = "https://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css"
         rel = "stylesheet">
      <script src = "https://code.jquery.com/jquery-1.10.2.js"></script>
      <script src = "https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
      
      <style>
         .ui-widget-header {
            background: #cedc98;
            border: 1px solid #DDDDDD;
            color: #333333;
            font-weight: bold;
         }
      </style>
      <script src="./startProgressBar.jquery.plugin.js"></script>
      <script>
      $( "<div />" ).appendTo( "body" ).progressbar({ value: 20 });
      </script>
   </head>
   
   <body>
      <h3>Disabled Progressbar</h3>
      <div />
   </body>
</html>

I tried this:

      <script>
      $( "<div />" ).appendTo( "body" ).progressbar({ value: 20 });
      </script>

and this:

$( "#elem" ).progressbar();

0

Browse other questions tagged or ask your own question.