Sibeesh Passion

Top Menu

  • Home
  • Search
  • About
  • Privacy Policy

Main Menu

  • Articles
    • Azure
    • .NET
    • IoT
    • JavaScript
    • Career Advice
    • Interview
    • Angular
    • Node JS
    • JQuery
    • Knockout JS
    • Jasmine Framework
    • SQL
    • MongoDB
    • MySQL
    • WordPress
  • Contributions
    • Medium
    • GitHub
    • Stack Overflow
    • Unsplash
    • ASP.NET Forum
    • C# Corner
    • Code Project
    • DZone
    • MSDN
  • Social Media
    • LinkedIn
    • Facebook
    • Instagram
    • Twitter
  • YouTube
    • Sibeesh Venu
    • Sibeesh Passion
  • Awards
  • Home
  • Search
  • About
  • Privacy Policy

logo

Sibeesh Passion

  • Articles
    • Azure
    • .NET
    • IoT
    • JavaScript
    • Career Advice
    • Interview
    • Angular
    • Node JS
    • JQuery
    • Knockout JS
    • Jasmine Framework
    • SQL
    • MongoDB
    • MySQL
    • WordPress
  • Contributions
    • Medium
    • GitHub
    • Stack Overflow
    • Unsplash
    • ASP.NET Forum
    • C# Corner
    • Code Project
    • DZone
    • MSDN
  • Social Media
    • LinkedIn
    • Facebook
    • Instagram
    • Twitter
  • YouTube
    • Sibeesh Venu
    • Sibeesh Passion
  • Awards
  • Linux Azure Function Isolated Dot Net 9 YAML Template Deployment

  • Build, Deploy, Configure CI &CD Your Static Website in 5 mins

  • Post Messages to Microsoft Teams Using Python

  • Get Azure Blob Storage Blob Metadata Using PowerShell

  • Deploy .net 6 App to Azure from Azure DevOps using Pipelines

How toJQuery
Home›How to›Change Page Layout Dynamically Using jQuery Layout Plug in

Change Page Layout Dynamically Using jQuery Layout Plug in

By SibeeshVenu
February 22, 2016
2141
0
Share:
Change Page Layout Dynamically

In this post we are going to see how we can change the layout a page dynamically, with out writing any CSS styles for the page. Sounds cool right? Are you afraid of writing the CSS styles which will suit for all the screens like Mobiles, Tabs, Monitors, High resolution? As I am not a good designer, I was worried all the time about the resolution issues whenever I use any custom styles. Here we will be using a jQuery plugin called jQuery Layout and we do have options to set our Footer, Side bar, Header and many more. Personally I liked this plug in , That is why I am sharing some information about this plugin. I hope you will like this.

Download the source code

You can always download the source code here:

  • Change Page Layout Dynamically
  • Background

    I came to know about this plugin when I was searching for some page layout for my application. Then I just installed it and started using. It is pretty simple to use. You can always download the files from the plug in page here.

    Using the code

    To start with this plug in, the first thing you are required to do is adding the necessary references. We are going to use three references, jQuery, jquery.layout-latest.js, layout-default-latest.css.

    [html]
    <link href="layout-default-latest.css" rel="stylesheet" />
    <script src="jquery-2.2.0.min.js"></script>
    <script src="jquery.layout-latest.js"></script>
    [/html]

    The next thing we need is some div elements, we can set it as follows.

    [html]
    <div class="ui-layout-center">Content area</div>
    <div class="ui-layout-north">Header</div>
    <div class="ui-layout-south">Footer</div>
    <div class="ui-layout-east">Sidebar</div>
    <div class="ui-layout-west">Sidebar</div>
    [/html]

    Now we will add the scripts.

    [js]
    <script>
    $(function () {
    $("body").layout({
    applyDefaultStyles:true
    });
    });
    </script>
    [/js]

    Here we uses applyDefaultStyles:true, this is for ensuring all the required default conditions/options are being applied automatically. Now if you run your page you will be seeing a layout as follows.

    Change Page Layout Dynamically

    Change Page Layout Dynamically

    And this is how your page will look like when you toggle every panes.

    Change Page Layout Dynamically WHen Toggling

    Change Page Layout Dynamically WHen Toggling

    Following are the key features offered by the development team as they have mentioned in their plug in home page here.

  • simple to use: powerful but simple syntax is easy to learn
  • unlimited layout capabilities: 5 regions per layout – unlimited nesting
  • dozens of options: every aspect is customizable, globally and by region
  • total CSS control: dozens of auto-generated classes create ANY UI look
  • extensible: callbacks, methods, and special utilities provide total control
  • custom buttons: integrates with your own buttons for a custom UI look
  • collapsable: each pane can be closed, using any UI animation you want
  • hidable: panes can be completely hidden, either on startup or at any time
  • resizable: each pane can be resized, within automatic or specified limits
  • slidable: panes can also ‘slide open’ for temporary access
  • headers & footers: each region has unlimited headers or footers
  • hotkeys: can use the cursor-keys and/or define custom hotkeys
  • use any elements: use divs, iframes or any elements you want as a ‘pane’
  • compatible with UI widgets: integrates with jQuery widgets and plug-ins
  • demo mode: set applyDefaultStyles option for a fully functional layout
  • The developers have provided so many demo of how we can use this plugin, you can always check those here.

    That is all, now you can start using this plugin. See the complete code below.

    Complete code

    [html]
    <!DOCTYPE html>
    <html>
    <head>
    <title>Change Page Layout Dynamically Using jQuery Layout Plug in</title>
    <meta charset="utf-8" />
    <link href="layout-default-latest.css" rel="stylesheet" />
    <script src="jquery-2.2.0.min.js"></script>
    <script src="jquery.layout-latest.js"></script>
    <script>
    $(function () {
    $("body").layout({
    applyDefaultStyles:true
    });
    });
    </script>
    </head>
    <body>
    <div class="ui-layout-center">Content area</div>
    <div class="ui-layout-north">Header</div>
    <div class="ui-layout-south">Footer</div>
    <div class="ui-layout-east">Sidebar</div>
    <div class="ui-layout-west">Sidebar</div>
    </body>
    </html>
    [/html]

    Conclusion

    Did I miss anything that you may think which is needed? Have you ever wanted to do this requirement? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.

    Your turn. What do you think?

    A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.

    Kindest Regards
    Sibeesh Venu

    TagsJQueryjQuery PluginPage Layout
    Previous Article

    Find Datatype Of Each Measures In SSAS ...

    Next Article

    Programmatically Extract or Unzip Zip,Rar Files And ...

    0
    Shares
    • 0
    • +
    • 0
    • 0
    • 0

    SibeeshVenu

    I am Sibeesh Venu, an engineer by profession and writer by passion. Microsoft MVP, Author, Speaker, Content Creator, Youtuber, Programmer.

    Related articles More from author

    • Code SnippetsJQuery

      Check whether an array element is undefined or not in jQuery

      May 31, 2015
      By SibeeshVenu
    • Remove an array element by its index
      CodeProjectJQuery

      Remove An Array Element By Index

      August 7, 2015
      By SibeeshVenu
    • Code SnippetsJQuery

      How to remove the spaces between the string in JQuery

      May 31, 2015
      By SibeeshVenu
    • Code SnippetsJQuery

      Get The Current URL in jQuery

      October 12, 2015
      By SibeeshVenu
    • JQueryPHP

      Calling an ASMX Web Service From Other Server Using jQuery and PHP

      December 29, 2013
      By SibeeshVenu
    • Code SnippetsJQueryJson

      Parse a string to Json in JQuery

      May 31, 2015
      By SibeeshVenu
    0

    My book

    Asp Net Core and Azure with Raspberry Pi Sibeesh Venu

    YouTube

    MICROSOFT MVP (2016-2022)

    profile for Sibeesh Venu - Microsoft MVP

    Recent Posts

    • Linux Azure Function Isolated Dot Net 9 YAML Template Deployment
    • Build, Deploy, Configure CI &CD Your Static Website in 5 mins
    • Easily move data from one COSMOS DB to another
    • .NET 8 New and Efficient Way to Check IP is in Given IP Range
    • Async Client IP safelist for Dot NET
    • Post Messages to Microsoft Teams Using Python
    • Get Azure Blob Storage Blob Metadata Using PowerShell
    • Deploy .net 6 App to Azure from Azure DevOps using Pipelines
    • Integrate Azure App Insights in 1 Minute to .Net6 Application
    • Azure DevOps Service Connection with Multiple Azure Resource Group

    Tags

    Achievements (35) Angular (14) Angular 5 (7) Angular JS (15) article (10) Article Of The Day (13) Asp.Net (14) Azure (65) Azure DevOps (10) Azure Function (10) Azure IoT (7) C# (17) c-sharp corner (13) Career Advice (11) chart (11) CSharp (7) CSS (7) CSS3 (6) HighChart (10) How To (9) HTML5 (10) HTML5 Chart (11) Interview (6) IoT (11) Javascript (10) JQuery (82) jquery functions (9) JQWidgets (15) JQX Grid (17) Json (7) Microsoft (8) MVC (20) MVP (9) MXChip (7) News (18) Office 365 (7) Products (10) SQL (20) SQL Server (15) Visual Studio (10) Visual Studio 2017 (7) VS2017 (7) Web API (12) Windows 10 (7) Wordpress (9)
    • .NET
    • Achievements
    • ADO.NET
    • Android
    • Angular
    • Arduino
    • Article Of The Day
    • ASP.NET
    • Asp.Net Core
    • Automobile
    • Awards
    • Azure
    • Azure CDN
    • azure devops
    • Blockchain
    • Blog
    • Browser
    • C-Sharp Corner
    • C#
    • Career Advice
    • Code Snippets
    • CodeProject
    • Cognitive Services
    • Cosmos DB
    • CSS
    • CSS3
    • Data Factory
    • Database
    • Docker
    • Drawings
    • Drill Down Chart
    • English
    • Excel Programming
    • Exporting
    • Facebook
    • Fun
    • Gadgets
    • GitHub
    • GoPro
    • High Map
    • HighChart
    • How to
    • HTML
    • HTML5
    • Ignite UI
    • IIS
    • Interview
    • IoT
    • JavaScript
    • JQuery
    • jQuery UI
    • JQWidgets
    • JQX Grid
    • Json
    • Knockout JS
    • Linux
    • Machine Learning
    • Malayalam
    • Malayalam Poems
    • MDX Query
    • Microsoft
    • Microsoft ADOMD
    • Microsoft MVP
    • Microsoft Office
    • Microsoft Technologies
    • Microsoft Windows
    • Microsoft Windows Server
    • Mobile
    • MongoDB
    • Monthly Winners
    • MVC
    • MVC Grid
    • MySQL
    • News
    • Node JS
    • npm
    • Number Conversions
    • October 2015
    • Office 365
    • Office Development
    • One Plus
    • Outlook
    • Page
    • PHP
    • Poems
    • PowerShell
    • Products
    • Q&A
    • Raspberry PI
    • React
    • SEO
    • SharePoint
    • Skype
    • Social Media
    • Software
    • Spire.Doc
    • Spire.PDF
    • Spire.XLS
    • SQL
    • SQL Server
    • SSAS
    • SSMS
    • Storage In HTML5
    • Stories
    • Third Party Software Apps
    • Tips
    • Tools
    • Translator Text
    • Uncategorized
    • Unit Testing
    • UWP
    • VB.Net
    • Videos
    • Virtual Machine
    • Visual Studio
    • Visual Studio 2017
    • Wamp Server
    • Web API
    • Web Platform Installer
    • Webinars
    • WebMatrix
    • Windows 10
    • Windows 7
    • Windows 8.1
    • Wordpress
    • Writing

    ABOUT ME

    I am Sibeesh Venu, an engineer by profession and writer by passion. Microsoft MVP, Author, Speaker, Content Creator, Youtuber, Programmer. If you would like to know more about me, you can read my story here.

    Contact Me

    • info@sibeeshpassion.com

    Pages

    • About
    • Search
    • Privacy Policy
    • About
    • Search
    • Privacy Policy
    © Copyright Sibeesh Passion 2014-2025. All Rights Reserved.
    Go to mobile version