The resizing function on the droppable element is malfunctioning on Mozilla browsers

I've been working on making one div both droppable and resizable. Surprisingly, everything is functioning perfectly in Chrome but not in Firefox.

If you'd like to see the issue for yourself, here is my jsFiddle demo that you can open in Firefox:
MY DEMO

Let me share a snippet of my code:

// main drop function for work area
$('#img-drop-container').droppable({
  accept: '.img-drop',
  drop: function(event, ui) {
    var $clone = ui.helper.clone();
    if (!$clone.is('.inside-drop-zone')) {
      $(this).append($clone.addClass('inside-drop-zone').draggable({
        containment: '#img-drop-container',
        stack: '.inside-drop-zone',
        zIndex: 100,
        cursor: 'pointer'
      }));
      $clone.removeClass('img-drop');

      // resize image
      //   $('.inside-drop-zone').resizable({
      //   aspectRatio: true,
      //   handles: 'ne, se, sw, nw'
      //   });
    }
  }
});

//clone the draggable items
$('li .img-drop').draggable({
  helper: 'clone',
  cursor: 'pointer',
});
ul {
    list-style:none;
}
#img-drop-container {
    background-color:#d8d8d8;
    border: 1px solid #9C9898;
    height:557px;
    width:99.9%;
}
.img-drop {
    height: 120px;
    width: auto;
}
#trash {
    float:left;
    margin-left:20px;
    margin-top:20px;
}
#trash {
    width:140px;
    height:140px;
    background-repeat: no-repeat;
    background-position:center center;
    z-index:2;
}
img {
    width:auto;
    height:auto;
}
.store-thumb {
    height: 50px;
    width: 50px;
}
#imgbg {
    float: right;
    left: -2%;
    position: relative;
    top: 4%;
}
.column {
    margin-top: -21%;
    margin-left:55%;
}
.resizable {
    width: 100px;
    border: 1px solid #bb0000;
}
.resizable img {
    width: 100%;
}
.ui-resizable-handle {
    background: #f5dc58;
    border: 1px solid #FFF;
    width: 9px;
    height: 9px;
    z-index: 2;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
<ul id="carousel" class="elastislide-list">
  <li>
    <div class="img-drop">
      <div style='resize: horizontal; height:20px; width: 100px; overflow: auto; border: solid gray 1px;float:left;  background-color: green;'></div>
    </div>
  </li>
</ul>
<div id="img-drop-container"></div>

Answer №1

Fiddle: http://jsfiddle.net/c38WX/40/

HTML: there is only a single div inside li

<div class="img-drop" style='height:20px; width: 100px; overflow: hidden; border: solid gray 1px;float:left;  background-color: green;'></div>

JQ:

include resizable widget functionality

$('li .img-drop').draggable({
        helper: 'clone', 
       cursor: 'pointer',
    }).resizable({ 
        handles: "e" ,
        autoHide: true
    });

Answer №2

Check out this interactive Fiddle that showcases a resizing feature, although the exact functionality is not completely clear.

JSFiddle Demo

Instead of relying on resize:horizontal, I opted for jQuery UI's resizable function (similar to your attempt) to manage the resizing aspect. Using handles: 'e, w' ensures the resizing is limited to horizontal movements only.

// Enable image resizing
$('.resize_box').resizable({
    handles: 'e, w'
});

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

Continuously querying the database in JSP to automatically fetch data

I've been exploring Spring recently and I'm curious if there is a way to set up automatic database polling using Spring 4. Ideally, I'd like the code to run without requiring the user to manually refresh any pages. Is it possible for my jsp ...

encoding the special character "ü" in json_encode as either 'ü' or '&#

I've developed a function that extracts the title from a given URL and returns it in JSON format. The function is invoked by an AJAX call. Everything works smoothly, but when a title contains characters like ü or any related ones, it returns null. Wh ...

Using Jquery to retrieve the window size and dynamically apply it to a div's CSS, adjusting it accordingly when the

Hey there! I'm trying to create a full-screen div, but unfortunately CSS doesn't seem to do the trick in this case. JavaScript/jQuery is my only option. My plan is to dynamically set the size of the div based on the browser window's dimensi ...

Execute a JavaScript function daily for each new user

Can someone help me understand how to execute a JavaScript/jQuery function that triggers a PopUp once for each new user visiting a webpage? Below is the code I need assistance with. $(window).load(function() { $('#index9').fadeIn("slow"); ...

What is the best way to determine font size based on the width of the

In order to ensure that certain elements on my page do not exceed specific widths, it is crucial for me to use a monospaced font. This will limit the horizontal "stride" between characters to stay within a specified threshold. However, simply setting the ...

Dividing an array into categories with typescript/javascript

Here is the initial structure I have: products = [ { 'id': 1 'name: 'test' }, { 'id': 2 'name: 'test' }, { 'id' ...

Problems revolving around the fundamental CSS drop-down menu concept

I'm struggling to center a CSS drop-down menu on my webpage without causing the drop-down effect to break. No matter what I try, it seems to mess up. What am I missing? Snippet of code: html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,b ...

Executing a Javascript Function within AngularJS

I encountered an issue where the error myFunction() IS NOT DEFINED is appearing: app.controller('myctrl',function(){ myFunction(); }); function myFunction() { debugger; document.getElementById("abc").disabled = false; } In this sce ...

Exploring the orderBy feature in the react-firebase-hooks library with NextJS

Recently, I've been utilizing the React Firebase Hooks package from this GitHub repository. The code snippet below has been functioning smoothly for me. const [posts, loading, error] = useCollection( firebase .firestore() .collection(& ...

Unlock the power of Odoo by learning how to seamlessly add custom field attributes without the need for modification

Currently, I am facing an issue with using my custom attribute for fields known as sf_group. The problem is that this attribute is not included in the field description retrieved via fields_get(). Is there a way to incorporate this custom attribute into th ...

Verify whether a specific element within an array of elements is currently in focus

Does anyone have a solution for detecting if any of the dynamically generated 'a' tags within an unknown number of elements currently has focus? if($('#wrapper ul li a:focus')) # there are multiple a tags that are dynamically generated ...

Having trouble getting the AJAX script to change the background in Internet Explorer?

I'm currently experiencing an issue with an ajax script. Here is the code I am using: <script type="text/javascript"> $(document).ready(function() { $('#savecolor').click(function(){ var myVar = 'data= ...

Navigating Links Inside a jQuery Mobile Panel

I've been searching high and low for the solution to this issue, but so far, I haven't had any luck. My dilemma lies within my jQuery mobile panel as I attempt to navigate to a specific section of the page: <div data-role="page" id="home"> ...

How disabling SSR is causing my styles to break in Nextjs

My Nextjs app is causing some issues with styling when I disable SSR to connect to Metamask using the window object. Specifically, the Navbar title style changes when SSR is disabled and the dev server is restarted: With SSR enabled: https://i.sstatic.net ...

Despite successfully passing props into V-for, the output does not display the props as expected

I've been attempting to accomplish a straightforward task, but for some reason, it's not working and I can't figure out why. Within the parent component, App.vue, I have the following: data() { return { servers: [ { ...

Updating the dynamic site script to be compatible with the newest version of the jQuery library

After finding a script on http://css-tricks.com/dynamic-page-replacing-content/, I decided to edit it to suit my needs. Initially, everything worked perfectly with "jquery-1.4.4". However, when I tried using versions later than "jquery-1.5", the active cla ...

The process of incorporating user properties into the output of a Service Bus topic from a Javascript Azure Function

I'm currently developing a TypeScript Azure Function that utilizes an Azure Service Bus topic as its output. Although I am able to send messages successfully, I have encountered difficulties in setting custom metadata properties for the message. In m ...

Using ngrx to automatically update data upon subscription

Background The technology stack I am using for my application includes Angular 4.x, ngrx 4.x, and rxjs 5.4.x. Data is retrieved from a websocket as well as a RESTful API in order to share it between multiple components through ngrx. Currently, data is ref ...

Button for navigating to the previous slide on a Jquery slider

There appears to be an issue with the code on the previous button. When the user presses "previous" on the first slide, there is a momentary blank slider before the last slide appears. Is there a way to make this transition smoother? Thank you for your a ...

What is the best way to incorporate data from my Input field into my Vue.JS application's existing data structure

Struggling with integrating new users into my personal project, particularly in passing input values (userName and userAge) to the parent element for addition to playersData. Here is a sample code snippet from the child component: `<template> <d ...