Issue with enabling drag behavior for JQuery resizable DIVs function in Wordpress

I'm attempting to create a layout with two divs positioned side by side, featuring a draggable center slider that can expand or contract the widths of these adjacent divs.

To accomplish this, I've integrated the jQuery Resizable plugin. Although the slider bar is visible, it's not responsive to dragging left or right.

The jQuery plugin has been properly enqueued to the Wordpress API:

wp_register_script('csukcode_script_9', plugins_url('assets/js/jquery-resizable-master/src/jquery-resizable.js', __FILE__));
wp_enqueue_script('csukcode_script_9');

How do I ensure that the slider correctly functions as intended? The jQuery code is embedded within a function set to trigger upon page load and accurately references the relevant div selectors.

jQuery(function($) {
$(".pan1").resizable({
   handleSelector: ".rpanrResize",
   resizeHeight: false
});
})
.outerSplitPane {
  display: flex;
  flex-direction: row;
  border: 1px solid silver;
  overflow: hidden;
  xtouch-action: none;
}

.pan1 {
  flex: 0 0 auto;
  padding: 10px;
  width: 300px;
  min-height: 200px;
  min-width: 150px;
  white-space: nowrap;
  background: #838383;
  color: white;
}   

.pan2 {
  flex: 1 1 auto;
  padding: 10px;
  width: 100%;
  min-height: 200px;
  min-width: 200px;
  background: #eee;
}

.rpanrResize {
  flex: 0 0 auto;
  width: 18px;  
  background: url(https://raw.githubusercontent.com/RickStrahl/jquery-resizable/master/assets/vsizegrip.png) center center no-repeat #535353;
  min-height: 200px;
  cursor: col-resize;  
}
  <div class="outerSplitPane">
    <div class="pan1" id="pan1">
      <textarea id="yourcode" cols="40" rows="10">#Write your code here</textarea>
    </div>
    <div class="rpanrResize" id="rpanrResize"></div>
    <div class="pan2" id="pan2">
      <pre id="output" class="output"></pre>
      <!-- If you want turtle graphics include a canvas -->
      <div id="mycanvas"></div>
    </div>
  </div>
</div>

View the development site live for an example:

Answer №1

Success! I discovered the solution.

The issue was that I forgot to properly include the jQuery library:

wp_register_script('csukcode_script_8', 'https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js');
wp_enqueue_script('csukcode_script_8');

Apologies for any inconvenience caused.

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

What's the best way to display two checkboxes on a single line?

I am working with checkbox filters in WooCommerce and I want to organize them so that two checkboxes appear in one row, followed by the next two in the second row, and so on. The issue can be seen at this URL. I also want this style to apply to "Product Co ...

Using Jquery & HTML5 for Seamless Transition between Portrait and Landscape Modes

I am working on making my HTML page more user-friendly for tablets. One issue I'm facing is that when the tablet's orientation changes, the menu doesn't hide correctly if the width is less than the height. Here is the code snippet I have so ...

Get the most recent 5 messages that haven't been read yet

I am attempting to utilize the GMAIL API in conjunction with JavaScript to extract unread messages from a user's inbox, specifically the last 5 messages. After successful login using the G+ API, I have been trying to employ jQuery's $.get method ...

Tips for adjusting the placeholder color in Material UI using React JS

Is there a way to customize the background color and flashing color of the Skeleton component in Material UI? I would like to implement custom styling for it, similar to what is shown below: <Skeleton variant="circle" classes={{root:'pla ...

Adding CSS style to an Image Resource in GWT: a step-by-step guide

Currently working with GWT and have an Image Resource object in use. For instance, ImageResource image = ClientResources.of().images().icon(); Looking to add some CSS styles to this image, however being that it's an ImageResource and not an Image o ...

Ways to display a horizontal ellipsis at the end of a paragraph

Utilizing an HTML entity to display three dots (...) is my current method of indicating that there is more text available. While CSS (text-overflow: ellipsis;) offers alternatives, I am restricted in using CSS styles. The problem lies in the fact that the ...

What is the solution to prevent a CSS flex column from expanding to fill the width in a row with three

I am trying to create a flex row with three columns, but when I only have two columns in the row, the second column gets pushed to the right side. You can see this issue in the image below. https://i.sstatic.net/cVVqB.png In the image, the red lines indi ...

Jquery pop-up information bubble

I'm currently using: jQuery Bubble Popup v.2.3.1 http://maxvergelli.wordpress.com/jquery-bubble-popup/ The following code should be included within the document ready section: $('.bubble').CreateBubblePopup({ align: 'cent ...

The bootstrap switch button remains in a neutral grey color

Ordinary: Initially clicked: Click again: After the second click, it remains grey and only reverts on a different action like mouse click or selection. Is there a way to make it go back to its original state when unselected? ...

Issue with mouseover in the jQuery area

As I navigate through a WordPress website, I am attempting to create a mandala using dynamic images. Utilizing jQuery and CSS areas, I aim to display the corresponding image when hovering over a specific section. However, I am facing an issue where there ...

Transfering data to Handlebars while rendering a template

Is there a method to pass a variable to a handlebars template during its rendering process? Below is the template in question: <script id="listingTopics" type="text/x-handlebars-template"> {{#each this}} <div class="wrapper_individual_listing ...

Load media upon the click of an image

I'm currently in the process of designing a team page for our website. Each team member's photo is displayed in a grid layout, with two boxes positioned below containing various content. Box 1: This box consists of basic text information. Box 2: ...

The text within the button disappears when in the :before state

After implementing the code from this codepen, I decided to use the 3rd button design. .btn { line-height: 50px; height: 50px; text-align: center; width: 250px; cursor: pointer; } .btn-three { color: #FFF; transitio ...

Scrollbar becomes inactive following the loading of AJAX content

Having an issue with loading a div using Ajax. The div loads, however the scrollbar within it stops working afterwards. In Main.html, I load content from other HTML files like so: <div id="content1" > </div> The content is loaded as follows: ...

Discover the method of using jQuery to identify a modification on a select element with an ID that is generated dynamically, and modify the choices available for selection

Our team has successfully implemented a user "profile" page with a two-column HTML table using a web framework (Rails 4.2.x). Users can dynamically add rows to this table by clicking an "add row" button, and everything is functioning as expected. The two c ...

What is the method to add gutters in Material UI grid without including margins?

I've been struggling for ages to make my responsive layout work properly! Whenever I add spacing to the Grid container with class=spotlight, things get misaligned. How can I add spacing to the gutters (the space between Grid items within the spotlight ...

The tooltip malfunctions when I incorporate the PHP variable

When I use PHP variables to return an HTML span tag, I am encountering an issue. The span tag contains a title field where I bind my PHP data. However, it seems to only accept the first sentence of my PHP value, causing it to not work properly. Below is th ...

``I'm experiencing an issue with the Bootstrap 4 accordion where it is only functioning properly for the

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css"> <script src="https://maxcdn.bootstrapc ...

What causes the footer to disappear in Rails with Bootstrap?

Within my application.html.erb file, my setup is pretty standard: <html class="h-100"> !head, title, scripts, styles, stylesheets removed for this example here on stackoverflow! <body class="d-flex flex-column h-100"> <!-- Dropdown St ...

How can I dynamically insert new div elements into a webpage with JQuery's .load method?

I want to constantly add new content instead of replacing the existing one in #message_here. How can I achieve this by generating new divs for each message? var last_mess_id = 1; $('#load_mess').click(function(){ $('#message ...