Open In App

jQuery UI Resizable widget() Method

The jQuery UI consists of GUI widgets, visual effects, and themes implemented using jQuery, CSS, and HTML. jQuery UI is great for building UI interfaces for the webpages. The jQuery UI Resizable widget() method is used to invoke the widget method. This method does not accept any parameters.

Syntax:



var widget = $( ".selector" ).resizable( "widget" );

Parameter: This method does not accept any parameters.

CDN Links:



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

Example:




<!doctype html>  
<html lang="en">  
   <head>  
      <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>  
         h1 {
             color: green;
         }
         .container{
             width: 170;
         }
   
         #right-div{
             float: center;
         }
         #left-div,#right-div 
         
             width: 150px; 
             height: 150px;   
             text-align: center; 
             border: 2px solid black;
         }  
      </style>  
      <script>  
         $(function() {  
            $( "#right-div" ).resizable();  
            var widget = $( "#right-div" ).resizable('widget');
            console.log(widget)
         });  
      </script>  
   </head>  
    
   <body
      <center>
           <h1>GeeksforGeeks</h1>  
           <h3>jQuery UI Resizable widget() Method</h3>
           <div class="container">  
              <div id="right-div">   
                 <h3 class="gfg">I'm widget</h3>  
              </div>
           </div>
      </center>
   </body>  
</html>  
  
  

Output:


Article Tags :