Maintain the fixed position of the horizontal scroll bar

I'm facing an issue with a popup window that displays a frameset. Within one of the frames, I'm using jQuery tabs to show some text.

The problem arises when trying to display long text or when resizing the window, causing the horizontal scroll to disappear and requiring the use of the vertical scroll to access the end of the page. I suspect the jQuery tab implementation, as the horizontal bar vanishes when it is removed.

I've attempted to adjust CSS attributes, but have not been successful in resolving the issue.

<script type="text/javascript>
  window.open("windowpoppup.html", "page",'width=1200px,height=400px,left=215px,top=25px,resizable=yes').focus();
</script>

windowpoppup.html

<frameset cols="250,"> 
    <frame name="displayTabs" src="other.html" marginheight="0" marginwidth="0"     scrolling="auto">
    <frame name="otherContent" src="myTabs.html" marginheight="0" marginwidth="0"     scrolling="auto">
</frameset>

myTabs.html

HTML

<div id="tabs">
<ul style="background-color: white; position: fixed; width: 100%;margin-top: 39px;">
    <li><a class="tab1" id="0" href="#tab1">tab1</a></li>   
    <li><a class="tab2" id="1" href="#tab2">tab2</a></li>
    <li><a class="tab3" id="2" href="#tab3">tab3</a></li>   
</ul>

<div class="div1" id="tab1"><pre>long text</prev></div>
<div class="div2" id="tab2"></div>
<div class="div3" id="tab3"></div>

JAVASCRIPT

$(function() {

$( "#tabs" ).tabs({
  activate: function (event, ui) {
      var index = $('#tabs').tabs('option', 'active');
  } });

  });

Answer №1

From what I gather, your goal is to create a responsive Pop Up that allows for scrolling even when the window size changes.

One way to achieve this is by utilizing the $(window).resize() function in JQuery.

// Adjust the padding as needed
var paddingBottom = 100;

// Set initial height
$('#tabs').height($(window).height() - paddingBottom )

// Listen for resize event
$(window).resize(function(){ $('#tabs').height($(window).height() - paddingBottom ) })

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

Issue with applying Angular animation to child element

Here I have set up two different animations. animations: [ trigger('fadeIn', [ transition('void => *', [ style({opacity: 0}), animate(500), ]), ]), trigger('fallIn',[ transition ...

Update the background image to be smoother, with no text overlay

I am working on a website where I need to smoothly change between background images. Here is the JavaScript code I currently have: var bg=[ 'images/best.jpg', 'images/61182.jpg', 'images/bg.jpg' ...

What is the best way to stop Quasar dropdown list from moving along with the page scroll?

I am facing an issue with my code while using Quasar (Vue 3.0). The code snippet in question is: <q-select filled v-model="model" :options="options" label="Filled" /> When the drop-down menu is open and I scroll the pag ...

Having trouble with the dynamic form not submitting correctly using AJAX in PHP?

I am facing an issue in my code while trying to dynamically generate a form in a table and submit it. The problem is difficult for me to solve. $(document).ready(function() { $('#btnsummary').on('click', function() { ...

Easy Registration Page using HTML, CSS, and JavaScript

In the process of creating a basic login form using HTML and CSS, I'm incorporating Javascript to handle empty field validations. To view my current progress, you can find my code on jsfiddle My goal is to implement validation for empty text fields ...

Text overlapping image causing hover state interference

I'm feeling completely lost right now. My goal is to have the title of each project displayed in the center of the screen when you hover over the respective project images. I've resorted to using jQuery for this because it seems like the most str ...

Create animations for ng-repeat elements without using ng-animate

Can the transition for changing the order of the model array in ng-repeat be animated using only CSS, without using ng-animate? ...

Is there a way to convert a URL into a clickable link and retrieve the YouTube code embedded within

I have retrieved a string from the database using PHP and I want to echo it. Within this string, there is a YouTube link that I would like to make clickable, as well as extract the YouTube code at the end of the link. How can I achieve this? For example: ...

What is the best way to transfer data to JavaScript?

Being new to JQuery and JSP, I am looking for guidance. My requirement: I need to pass specific arguments from one JSP page to another JSP page and access these arguments within the JavaScript code on the receiving JSP page. Details: The arguments cons ...

Sorting a select element using Javascript/JQuery while taking into consideration the label attribute present in the options

It came to my attention that the jQuery options and examples only covered the text and value attributes, causing errors when attempting to add the label attribute. I am looking for a way to include the label attribute in the sorting process, especially whe ...

How can I modify the value of a CSS animation rule in AngularJS?

I am looking to dynamically change the value assigned to stroke-dashoffset based on a custom input. @-webkit-keyframes donut-chart-1 { to { stroke-dashoffset: 100; } } @keyframes donut-chart-1 { to { stroke-d ...

When the enter key is pressed, the form will be automatically submitted

My current implementation includes the utilization of Bootstrap input tags as shown below: myPage.html <form th:object="${field}" name="modal" method="post" th:action="@{/ajouterFieldEcran}"> ... <div class="form-group row"> <label ...

Storing the values of three checkboxes in individual variables to be passed into distinct columns

Below is the HTML code for checkboxes, with a function that limits only three selections: <form class="interestSearchCriteria"> <input type="checkbox" name="walking" value="Walking"> Walking <input type="checkbox" name="running" value=" ...

accepting decimal values for x-editable input field

Recently, I started using x-editable along with bootstrap and came across a roadblock. Here is the HTML field definition: <div class="form-group"> <label class="col-sm-4">Service Charges(%)</label> <div class="col-sm-6 hoverE ...

The header bar intrudes into the main content area

I am in the process of transitioning my landing page design from Bootstrap to Semantic-UI. The layout includes a fixed top navbar and main content split into two columns (3-cols and 9-cols) - the left column is reserved for a sidebar, while the right colum ...

Make sure to add CSS styles to the "ul" class first, followed by

I'm looking to update the color of the links in my footer using CSS. I want to change the color of all a items that have the same classes, but I'm unsure of how to do this with CSS. Here's the code snippet: <div class="col-lg-3 ...

PHP and Bootstrap combine in this dynamic carousel featuring thumbnail navigation

Looking to create a dynamic bootstrap carousel with image thumbnails at the bottom? After exploring various code snippets and solutions, I stumbled upon this link. While the code worked, I found the thumbnails to be too small. Below are the functions I use ...

Struggling to grasp the concept of DOM Event Listeners

Hello, I have a question regarding some JavaScript code that I am struggling with. function login() { var lgin = document.getElementById("logIn"); lgin.style.display = "block"; lgin.style.position = "fixed"; lgin.style.width = "100%"; ...

Exploring the hover effect in CSS pseudo classes

I currently have a sub menu that consists of 4 headers. The code snippet provided below is used to style the first element in each column of the submenu. My next task is to create a hover effect for these elements, where the background color changes to gr ...

Identifying and handling the removal of a complete div element by the user

Is it possible to remove the entire div element if a user tries to inspect the web browser using the script provided below? <script type="text/javascript"> eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/, ...