Steps to create full screen jQuery tabs with overflow scroll feature in the content

I am in the process of creating a responsive web design using jQuery tabs. My goal is to make one page of the website occupy the entire screen (100% height and width), have a fixed height for the div.ui-tabs-nav, and enable scrolling for the content of div.ui-tabs-panel if it extends beyond the current window size.

Here is the basic layout structure I am working with:

<div id="queue_tabs">
    <ul>
        <li><a href="queue_list.php?show=active">Active</a></li>
        <li><a href="#tabs-completed">Completed</a></li>
    </ul>
    <div id="tabs-active">...</div> <!-- This section will be generated by jQuery automatically. -->
    <div id="tabs-completed">...</div>
</div>

Please note that even though the content will be loaded through AJAX, I have omitted it from the accompanying jsFiddle.

In the CSS file, the following properties have been defined:

#queue_tabs {
    height: 100%;
    width: 100%;
}

#queue_tabs .ui-tabs-panel {
    height: 90%; /* <--- This is the issue I am facing. */
    overflow: auto;
}

As you can observe, to make the div.ui-tabs-panel expand, I had to specify a specific height value relative to the window height (90%), causing the div to adjust perfectly only under certain conditions.

Is there a method to cover the entire vertical space while still allowing overflow to be displayed?

Answer №1

It seems like a crucial piece is missing from your code:

html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}

I recommend incorporating this snippet into your code. Make sure there are no elements causing the body / html width to exceed 100%, as this could result in a horizontal scrollbar.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The layout of an HTML and CSS page does not adjust according to the size of the

Having trouble scaling down my HTML and CSS code properly using only %'s and vw's. The entree div and drink div are dynamically populated, making formatting even more challenging. <!DOCTYPE HTML> <html> <link rel="stylesheet" h ...

Navigating the elements within R Shiny: A comprehensive guide

Can anyone help me figure out how to access specific elements in my Shiny app using their HTML tags? In this particular example, I need to retrieve all h1 elements along with their respective labels and IDs. library(shiny) ui <- fluidPage( h1("Get" ...

Menu options arranged vertically, revealing submenus that fly out upon mouse hover

I am attempting to develop a vertical menu with flyouts, which includes sub-menus. Can you point out any issues in the code provided below? <html> <head> <title>Untitled Document</title> <style type="text/css ...

Tips for managing content and tables that exceed their container's boundaries

On my webpage, I have a slide-out sidebar that shifts the other contents and causes overflow with a scrollbar. I want the content to remain inside the window and adjust according to the available space. Image of Slide-out Sidebar As seen in the image, t ...

Arrange two input fields side by side if the quantity of input fields is unspecified

I am currently in the process of developing a project using Angular. I have implemented an *ngFor loop to dynamically add input fields based on the data retrieved from the backend. Is there a way I can ensure that two input fields are displayed on the same ...

Creating an embedded link to a website that adjusts to different screen sizes while also dynamically changing

I've been developing a personalized site builder that includes an iframe for previewing responsive websites. In order to make the site 'zoomed out' and not appear in mobile size, I'm utilizing CSS scale and transform origin as shown bel ...

Images that adapt to various sizes while maintaining a consistent visual hierarchy

Hey there, I'm struggling to achieve the same row size of images as shown in the example. However, when I adjust the window size, the larger images become smaller than the columns on the left. This has been a challenge for me and I haven't found ...

What is the best way to extract the name from JSON data?

I have a list of items in my HTML with data attributes. When a user clicks on one of the items, I want to display or append a list of related suburbs for that selected item in another list. This is being achieved using ajax. <ul id="cities"> <l ...

What is the best method to display each HTML output on a separate line using Python?

As a beginner, I am working on a small project involving webscraping. My goal is to print the lyrics of a song with each line on a separate line using Beautiful Soup in Python. However, the output I'm getting looks like this: I looked out this mornin ...

Show random images of different sizes by employing jquery

I am seeking a solution for my webpage which currently loads a random image from an array and centers it using negative margins in CSS. While this method works fine with images of the same size, I am looking to modify the code so that it can handle images ...

Deserialization does not support the use of Type System.Collections.Generic.IDictionary for an array

An issue might arise when trying to call a page method using a manually created JQuery.ajax request. The deserialization process is handled by .NET and not within the user's code. Javascript: MyParam = []; ... $.ajax({ type: 'POST', ...

Select Multiple Checkboxes in Bootstrap/HTML

Is there a way to make it so that selecting one checkbox will automatically select all the others in Bootstrap/HTML? ...

Can Material UI be utilized to design a Shopify e-commerce store?

As I prepare to create a Shopify storefront for the first time, I have a few inquiries. I have noticed how convenient it is to design both a mobile and desktop view using Material UI, but I have come across conflicting information online. Some sources su ...

Headline at the top of the page, perfectly centered with a division below

Trying to create an effect where there is a div that is centered both vertically and horizontally within a dynamic containing div. This can be achieved with the following CSS: #centered-div { vertical-align: middle; margin: auto; } However, I als ...

Generate two separate CSS files (Mobile and Desktop versions) by compiling a Stylus (.styl) file using Node.js

Can a single Stylus file be compiled into two separate CSS files? For example, one optimized for mobile without the -moz and webkit elements, and another for cross-browser applications? Thank you. ...

Storing information using ajax and json technologies

I've inherited a project where I need to work on saving data to the database using an input. The function responsible for this (SaveData) is not functioning properly. Since I'm not very familiar with ajax and json, can someone please help me iden ...

Toggle the visibility of a div based on the user's session status

Having an admin link with the div id "admin" and starting sessions when a user is logged in helps distinguish between normal users and admins. While normal users are restricted access to files designated for admin only, they can still view the admin link. ...

Trouble with attaching a click event to a jQuery datepicker

I am attempting to attach a click event to .ui-state-default after a jQuery datepicker has been displayed (I do not have access to the html generating the datepicker so I cannot utilize any datepicker-specific events) and it functions properly using $.bind ...

The "Boostrap Confirmation" plugin in JQuery fails to appear upon the second click

After changing the confirmation method from an MVC Action to an Ajax method, I noticed that the confirmation box does not appear when clicking a second time. It seems to have stopped working possibly because the page is no longer being refreshed. How can ...

How can I open a new window, redirect the current one, and bring focus to the new window using JavaScript?

Trying to troubleshoot a problem I'm having with the following setup: - Using SAP Portal, I am launching an HTML page containing this code. - The goal is for the HTML page to open a new window. - Once the new window opens, the original HTML page ...