Resizing with Jquery results in sudden movement

I have used jQuery to create a set of buttons inside a <ul> element. I am now attempting to resize the <ul> by adding a handle to the top of it, but when I try to resize it, the element jumps as shown in the images below. What could be causing this issue?

Before Resize

After Resize

jQuery Function Used to Generate Elements:

function create_bar() {
        var table_container = $("<ul />", {
            class: "app_container_T t_ul ui-widget-content"
        });
        table_container.resizable({ handles: "n" });
            var row = $("<li />");
                var menu = $("<ul />", {
                    class: "menu_T t_ul"
                });
                    var section_1 = $("<li />");
                        var add_element_button = $("<button />", {
                            text: '+',
                            click: add_content_selection_element,
                            class: "large_menu_button_T"
                        });
                        section_1.append(add_element_button);                                      
                        /*Remaining buttons are created and added similarly*/
                    menu.append(section_1);
                row.append(menu);
            table_container.append(row);
        $('body').append(table_container);

CSS Styles:

.app_container_T {
    position:fixed;
    bottom:0;
    left:0;
    z-index: 998;
    background-color:grey;
    margin: 0;
    padding: 0;
}
.app_container_T > li {
    display: inline-block;
}
.t_ul {
    list-style: none;
}
.app_container_T * {
    box-sizing: border-box;
    border-radius:5px;
    vertical-align : text-bottom;
}
.menu_T {
    background-color:lightblue;
    padding: 0px;
    width:60px;
}
.large_menu_button_T {
    background: #0016f0;
    color: #ffffff;
    height: 50px;
    width: 50px;
    margin: 3px;
    font-size: 20px;
    border-radius:10px;
}
.ui-resizable-n {
    cursor: n-resize;
    width: 100%;
    top: 0px;
    left: 0;
    border-top: 5px solid #f00;
    z-index: 999;
}

Generated HTML Structure:

<ul class="app_container_T t_ul ui-widget-content ui-resizable">
    <div class="ui-resizable-handle ui-resizable-n" style="z-index: 90; display: block;"></div>
    <li>
        <ul class="menu_T t_ul">
            <li>
                <button class="large_menu_button_T">+</button>
                <button class="large_menu_button_T">T</button>
                <button class="small_menu_button_T options">o</button>
            </li>
        </ul>
    </li>
</ul>

Answer №1

One issue arises when the bottom property is fixed at 0 because any resizing or repositioning will cause problems since it changes relative to bottom: 0

.app_container_T {
    position:fixed;
    bottom:0; ////// removing this will solve the problem
    left:0;
    z-index: 998;
    background-color:grey;
    margin: 0;
    padding: 0;
}

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

Error: JSON parsing failed due to an unexpected token "u" at the beginning of the JSON string. This occurred in an anonymous function when

Implementing reCaptcha in my firebase project has been successful. I am now sending form data and the captcha response using grecaptcha.getResponse() to my server upon clicking the send button. Below is the code snippet from client.js: $('.sendUrl ...

Store data in LocalStorage according to the selected value in the dropdown menu

Can you help me understand how to update the value of a localstorage item based on the selection made in a dropdown menu? <select id="theme" onchange=""> <option value="simple">Simple</option> <option valu ...

Troubleshooting a positioning issue in an ExtJs Grid due to a CSS conflict

After integrating the ExtJs Grid into my existing webpage, I encountered a CSS conflict. The conflicting CSS was identified in my current stylesheet, but unfortunately I am unable to modify it as the entire website is built upon it. Attempts with ctCls, b ...

Can you provide guidance on how to use Javascript to submit a form specifically when the input name is labeled as "submit"?

Query: How can I use Javascript to submit a form when one of the form inputs is named submit? Scenario: I need to send users to another page using a hidden HTML form. Unfortunately, I cannot modify the names of the inputs in this form because it needs to ...

What is the correct method to properly encode JSON that may include HTML when displaying it in an HTML file?

After searching through numerous questions, none seem to address this specific scenario. app.get('/', function(req, res) { res.set('Content-Type', 'text/html'); res.send(`<html> <body> Hello, World! </body&g ...

Chrome is blocking my ajax cross-origin request, causing it to be cancelled

I have been working on a Google Chrome extension and encountering an issue with my ajax requests. Every time my extension sends a request, it ends up getting cancelled for some unknown reason. The following code snippet seems to be functioning properly: ...

The ReactJS script encountered an error at line 2 of the jquery.min.js file, displaying an unrecognized expression syntax error with the hashtag

I have encountered an issue with React-route-dom Link while using it in the Navbar. The following error is displayed: Uncaught Error: Syntax error, unrecognized expression: #/login at Function.ga.error (jquery.min.js:2) at ga.tokenize (jquery.min. ...

Utilizing the <style scoped> feature within my Angular template

When adding CSS styles in the specified htm file's templateUrl while loading a directive, I wonder if this is a bad idea. Will it be repeated every time the template is instantiated on the rendered page, or does Angular handle this differently? By usi ...

Enhancing Material UI icons with a sleek linear gradient

Despite following the instructions in this post Attempting to incorporate a linear gradient into a MaterialUI icon, as per a comment's recommendation, I am unable to get it to work. I experimented with the idea that the icons could be considered text ...

Ensure at least one checkbox is selected by using jQuery validation

I wrote the code below to select multiple checkboxes and validate that at least one checkbox is selected. The data submission to the database works if I remove onsubmit="return validate_form()". However, I want to ensure that at least one checkbox is selec ...

Tips for extracting data from JQgrid rows

I've been working with Jqgrid, attempting to retrieve row values on the Context menu click event. Unfortunately, I haven't been successful in getting the values. Below is the code I've been using to try and obtain the row values: loadComple ...

Keeping the header in place: fixed positioning

This particular situation is quite challenging for me. I have a webpage that requires horizontal scrolling. There is a menu at the top of the page that needs to remain centered on the page at all times. Even with the use of jQuery, I am uncertain how to ac ...

Interactive jQuery feature for dynamic search suggestions across multiple entries

Here is the HTML code snippet I am working with: <input name="data[Content][0][name]" type="text" class="content_name_1" id="content_name"> <input name="data[Content][1][name]" type="text" class="content_name_2" id="content_name"> ...

Refresh a function following modifications to an array (such as exchanging values)

Looking to re-render a function after swapping array values, but the useEffect hook is not triggering it. I need assistance with this as I plan to integrate this code into my main project. Below are the JSX and CSS files attached. In App.js, I am creating ...

The list item click event is not triggered when new list items are added

I've run into a bit of confusion with my code. Everything seems to be working perfectly fine until I introduce new items. Take a look at a sample of my items However, once I make changes to my list, the click function stops working. Check out a sa ...

React Ant Design: Encountered a warning for 2 elements having non-unique properties

I have incorporated the Carousel component, with each one containing a different component. One contains a form, while the other includes an external library component called react-input-otp. https://codesandbox.io/s/pensive-einstein-uucvm?fontsize=14& ...

PHP search function malfunctioning

I'm feeling quite confused about the current situation. I am utilizing a form that requires a student code input of "lz." <form action="classgrades.php?id=<?php echo $courseid ?>" method="post"> <input type="text" name="studen ...

Adjust text size automatically to fit into a container with a fixed size

Looking to dynamically adjust the font size of user-entered text to fit within a fixed-size div. The goal is to have the text fill the box as much as possible. For example, if the div is 400px x 300px and the user enters "ABC", the font will be very large ...

Establishing headings and frames for a collection of Essays

I have integrated a RSS Feed into my Vue.js application to display a series of articles. I want to organize these articles in a container similar to tweets on the left, with a heading labeled Latest Articles. However, when I use a tag in the template sect ...

The text field is being styled with inline styles automatically

I am trying to set a custom width for a textarea in my form, but the inline styles are automatically overriding my CSS. I have checked my scripts, but I am unsure which one is manipulating the DOM. If you have any insight, please let me know. This is the ...