Issue with unique scrollbar customization tool

To access the plugin, visit:

My webpage is still a work in progress: XXX

Both divs move simultaneously when scrolling down! I am unfamiliar with jQuery and java, can someone assist me?

Answer №1

The issue you are facing is due to having two <div> elements with the same id attribute, specifically:

<div id="mcs4_container">

This snippet appears more than once in your HTML code. Remember that id attributes must be unique within a page. To resolve this, consider changing one of them to something like:

<div id="mcs6_container">

Adjust your jQuery accordingly:

$("#mcs6_container").mCustomScrollbar("vertical", 200, "easeOutCirc", 1.25, "fixed", "yes", "no", 0); 

Alternatively, you can combine both bindings like so:

$('#mcs4_container, #mcs6_container').mCustomScrollbar("vertical", 200, "easeOutCirc", 1.25, "fixed", "yes", "no", 0);

This could also be a simple copy-paste oversight. Take note that there are multiple "mcs*_container" <div>s referenced in your jQuery logic.

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

Utilizing Laravel 5 to Send Password Reset Link via Ajax

I'm currently troubleshooting a code snippet that I have: jQuery.ajax({ type:"POST", url:"/password/email/", data:{ _token: jQuery("#forgotPasswordContainer input[name='_token']").val(), email: email }, d ...

Tips for aligning a row of images to the right in Bootstrap 4

I have several images that I want to display on the right side in a block. Here is what I attempted: <div class="row" > <div class="float-right"> <img src="1.png"/> <img src="2.jpg"/> ...

Tips for concealing specific sections or content on a tab

I am looking to implement a layout with 4 tabs where the content of each tab is initially hidden and only becomes visible when that specific tab is clicked. For example, if the user clicks on the 1st tab, then the content associated with that tab should ...

Button Vote in Bootstrap is unresponsive

I have a voting system implemented on my website using normal CSS buttons, and it works perfectly fine. However, when trying to integrate it with Bootstrap buttons, it seems to not function properly. I am looking to switch to using Bootstrap buttons for t ...

`Arc canvas countdown timer`

My countdown timer created using canvas is functioning well, but I am encountering some issues: I would like to align the circle representing seconds with the circles for minutes, hours, and days similar to this demo. Please ensure running the code snipp ...

Ways to transform epoch timestamp to present timestamp?

Is there a way to accurately convert an epoch timestamp in milliseconds to the current timestamp in milliseconds? My Attempt: var currentTime = (resp.timestamp * 1000) + 1980000000; resp.timestamp represents the epoch timestamp I attempted to add 5 ho ...

Incorrect Positioning of Cloned Draggable Items in jQuery UI

Here's something interesting to explore: http://jsfiddle.net/pzT8h/5/ If you drag an item initially, everything seems fine. However, if you scroll down the page and then try dragging an item, you'll notice that the position is off. All I' ...

What is the best way to utilize a JavaScript variable as a background within an inline style sheet?

I have a fun project for this evening - I am trying to make my website load a different background image every time the page is refreshed. Earlier on in this project, I managed to make the background interact with window size and screen resolution similar ...

Is :before functionality not compatible with img tags?

Is there a way to use the :before selector in CSS to overlay an image on top of another image? I have tried implementing it, but it seems that placing an image before an img element doesn't work as expected. Here is the CSS code I am using: .containe ...

What is the best method to replace the `click` event of an element selected using jQuery?

As I work on my program, I am attempting to alter the click event of a jQuery element. However, rather than modifying it as expected, it seems to be adding a new event each time. $myelem = $('.nav-item'); $myelem.click(function(){ console.lo ...

Show an SVG overlay when hovering over an image

Is there a way to create a hexagon shape around an image when it is hovered over using CSS only, even if the image itself has a circular border-radius of 50%? ...

Error in WordPress Toolset Pagination

My issue is straightforward, but I am worried that the solution might not be as simple. I have been developing a website at: This site utilizes WordPress with Avada Theme and Toolset Plugins enabled. The only other plugins in use are BackupBuddy and Cont ...

Customizing Geonames JSON Ajax Request

Having found the code I needed from a sample website, I am now seeking help to customize it to only display results from the USA. This is the current code snippet: $(function() { function log( message ) { $( "<div>" ).text( message ).pr ...

Tips for modifying the size of the <code> tag against a background?

Is there a way to adjust the width of text within a (code) tag so it always fits within the background? I want the text in the (pre) element to resize along with the background as the browser window resizes. Please see the pictures below for reference: I ...

Encountering the error message "Undefined variable '$'" in a script that is loaded after jQuery

My code is simple - it loads jQuery first, followed by a script that uses the $ syntax. However, I keep encountering the error: ReferenceError: $ is not defined Initially, I suspected that the async attribute on the script tag was the issue, but changi ...

What is the best way to conceal floated elements with overflow in CSS?

How can I ensure that my block container element only displays the content of block elements, cutting off any floated elements that are taller than the parent container? Applying overflow: hidden seemed like a simple solution, but it created a new block f ...

Dealing with the MethodNotAllowedHttpException issue while implementing AJAX in Laravel 5

I'm currently attempting to use ajax to upload an image, but I keep receiving the following error message: Failed to load resource: the server responded with a status of 500 (Internal Server Error). Below is my ajax code: $('document').read ...

Sorting through a table based on the name of the element

I am currently working on filtering an HTML table using a search form. It's working great, but I'm facing an issue where the filtered elements are trying to fill the entire width of the table instead of maintaining their original width (which is ...

What is the correct way to utilize CSS for setting a responsive background image for an element?

When I set the background-image for an <a>, it always requires specifying the width and height in the stylesheet file. This causes the URL image to not be responsive. I've tried solutions such as using background-size: cover; and background-colo ...

Struggling to map JSON data (received from WCFRest) onto an HTML table

After creating a WCFRestful service that populates data in JSON format as shown below: {"GetEmployeesJSONResult":"[{\"Name\":\"Sumanth\",\"Id\":101,\"Salary\":5000},{\"Name\":\"Sumanth\",\"I ...