When using the overflow:scroll property, the slider gif fails to appear on

I recently added a floating gif along with a slide out form to collect lead information. The setup works perfectly, but I noticed that on lower resolution screens, the form gets cut off. To address this issue, I considered adding a scroll bar. However, when I tried adding a scroll bar to the form, the gif disappeared.

Here is the CSS being used:

/*slide-out-div */
 .slide-out-div {overflow:scroll;padding: 20px;background: #ccc; border:1px solid black;width:250px;}  

And here is the HTML form code:

<div class="slide-out-div">

You can view the website at www.dealerclick.com

Answer №1

The issue at hand is the positioning of the "handle" to the right of the form container with a negative absolute position. This results in the handle being hidden when overflow is set to auto or scroll, as expected.

This behavior is not a mistake, but rather how CSS functions. To address this, one solution is to apply overflow: auto specifically to .slide-out-div form, ensuring that only the form itself displays scroll bars (revealing any width miscalculations).

Using overflow:auto is preferable over overflow:scroll to prevent unnecessary scrollbars, aligning with good UX practices.

However, another challenge arises when using overflow: auto and the page lacks sufficient height due to the fixed position of the div. In such cases, implementing JavaScript to detect window height is recommended:

var window_height = window.innerHeight;
if (window_height < 668) {
   $('.slide-out-div form').css('overflow', 'scroll');
}

This script determines if the window height accommodates the form's full height plus its top offset (668px on your page). If the space is inadequate, it adds scroll bars accordingly for optimal display.

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

Ways to incorporate a tertiary tier in my CSS dropdown navigation

I currently have a CSS code that displays a two-level menu, but I'm looking to expand it to include a third level. Unfortunately, I'm stuck and unsure of what changes to make in the CSS. Below is the existing code: #topnav{ // Existing CSS p ...

Guide on separating a variable by commas using jQuery

After making an Ajax call to a Java servlet, I am retrieving data and storing it in the 'data' variable upon success. Here is the code snippet: var s1=""; var ticks =""; $('#view').click(function(evt ...

Is JSON indicating that it's undefined?

After executing my server side code, it returns an array: return array('success'=>true, 'client_id' => $_GET['id']); The array is then echoed as follows: echo htmlspecialchars(json_encode($result), ENT_NOQUOTES); Whe ...

Can an image map area be identified using radial coordinates?

While I have experience with online Imagemap Generators for rectangular or circular areas in HTML pages, things get a bit tricky when dealing with pie-shaped sections. When trying to make each pie slice a separate area, the image map code generated by thes ...

Transforming iframe programming into jquery scripting

Currently, I have implemented an Iframe loading the contents within every 5 seconds. It works well, however, there is a consistent blinking effect each time it loads which can be quite bothersome. I am looking to replace the iframe with a scrolling div so ...

"Error alert: The specified property 'Iscontains' cannot be read because it is undefined" appears in the script for this video

I am currently utilizing AJAX to interact with my backend code. I retrieve URLs from the database and then render them onto the DOM, displaying videos accordingly. However, I am encountering an issue where Uncaught TypeError: Cannot read property ' ...

Getting AJAX to function on a local server with either XAMPP or node.js

I am completely stumped and in need of some assistance. My current challenge involves trying to implement AJAX on a local server, but I am feeling lost when it comes to even the most basic coding. I have installed node.js and XAMPP to my system and have b ...

What is causing the data in the hierarchy table to be invisible?

I am attempting to build a hierarchical table using Vue.js as the foundation. However, I want the table to remain hidden with no data displayed. The issue seems to be within this section of code: <tr v-if="item.childrenVisible" v-for="chi ...

Utilizing Jquery autocomplete feature with JSON input in a Rails 3 environment

$(function() { $('.autocomplete_address').autocomplete({ minLength: 0, delay: 600, source: function(request, response) { $.ajax({ url: "/welcome.js", dataType: "json", data: {search: request.search}, ...

How to Exclude a Selector in Jquery?

I have a form that I clear when focused. The entire form is selected and works well, except that the submit button becomes blank upon clicking. Is there a way to exclude my input of input#submit from the code below? $(".wpcf7-form input, .wpcf7-form ...

Ways to retrieve session variables within a PHP code?

I'm working on a notifications feature and encountering an issue with my jQuery function calling the "NOTIFICACIONES.php" script using AJAX. The PHP script is supposed to fetch data from the database using the current user's ID, but in the ajax s ...

Guide on implementing CSS modules in a WordPress plugin built with React

Within one of my tsx files, I included this line: import styles from "../../styles/buyTicket.module.css"; This resulted in the following error message: ERROR in /Applications/MAMP/htdocs/wp-content/plugins/tikex/tikexModule/components/BuyTicket/ ...

Issue with PHP functionality not functioning properly

I've been working on implementing an AJAX Form to allow users to upload their profile picture on my website. However, I've encountered some difficulties with the process. I have created a PHP page where the form is supposed to be posted using AJA ...

Which is the better option: using a nonce for each function or one for all AJAX calls?

My approach to security in WordPress includes the use of nonces, which serve as an additional layer of protection. These nonces are essentially hashes that are sent to the server and change every few hours. If this hash is missing, the request will be dee ...

Having trouble with submitting a form using jQuery?

I have created a form on my website: <form action="thanks.php" onsubmit="return false" class="submitForm"> ... Various input fields ... </form> Additionally, I have included a jQuery script: $(document).ready(function() { $("form.subm ...

Ajax is encountering an error in the fail function... Nevertheless, it is successfully completing its intended task

I have encountered a strange issue with my PHP/jQuery project. Upon calling the Ajax request, instead of triggering the 'done' function, it seems to be invoking the 'fail' function. Here is the current code snippet: $("#form").submit ...

What is the method to store anchor text in a Session variable?

I'm currently working on a project where I've linked multiple pdf files in the master page. When clicking the anchor, the page redirects to the specified location and displays the pdf in an iframe. Now, I want the text within the anchor tag to be ...

The dynamically created array length is indicating as null

Although this question has been asked numerous times, most answers are in plain JavaScript. I have a function that generates an array with product data. This array is then utilized in another function to retrieve new data via JSON. $(function(){ var p ...

Can you explain the purpose of the animated class?

$('button').addClass('animated bounce'); $('.well').addClass('animated shake'); $('#target3').addClass('fadeOut'); Can you explain the purpo ...

"Enhancing the speed of the JavaScript translate function when triggered by a scroll

I am facing an issue with setting transform: translateY(); based on the scroll event value. Essentially, when the scroll event is triggered, #moveme disappears. For a live demonstration, please check out this fiddle: https://jsfiddle.net/bo6e0wet/1/ Bel ...