Sunday, 18 December 2016

jQuery UI Resizable Div Control

12/18/2016 - By Pranav Singh 0

This article will show you how you can create a resizable div control with the help of mouse control using jquery ui and css for your asp.net, mvc, html application.

So for this article first we will add the below mention library reference.


<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">

Now add the below style into the header of the page.

<style>
        #resizable {
            width: 150px;
            height: 150px;
            padding: 0.5em;
             background-color:red;
        }

            #resizable h3 {
                text-align: center;
                margin: 0;
                background-color:red;
            }

    </style>

Now have a look of the below javascript code.

<script>
        $(function () {
            $("#resizable").resizable();
        });
    </script>

The above code is responsible for creating the re sizable div control. In this I have passed the div id. Now check the complete code of the page.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>jQuery UI Resizable Div Control</title>
    <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
    <style>
        #resizable {
            width: 150px;
            height: 150px;
            padding: 0.5em;
             background-color:red;
        }

            #resizable h3 {
                text-align: center;
                margin: 0;
                background-color:red;
            }

    </style>
    <script>
        $(function () {
            $("#resizable").resizable();
        });
    </script>
</head>
<body>
    <div id="resizable" class="">
        <h3>Resizable</h3>
    </div>
</body>
</html>

Now we have done run the application and check the output.


About the Author

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Get Updates

Subscribe to our e-mail newsletter to receive updates.

Share This Post

0 comments:

Please let me know your view

Free Ebooks


About Us

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Contact Us

For writing article in this website please send request by your

GMAIL ID: dotnetpools@gmail.com

Bugs and Suggestions

As we all know that this website is for sharing knowledge and providing proper solution. So while reading the article is you find any bug or if you have any suggestion please mail us at contact@aspdotnet-pools.com.

Partners


Global Classified : Connectseekers.com
© 2014 aspdotnet-pools.com Designed by Bloggertheme9.
back to top