Adjusting the drag mouse position in jqueryUI

I'm currently working on coding a Lockscreen design inspired by ios8. I want to create a draggable element that only moves along the x-axis.

$( "#IDlsDragable" ).draggable({ axis: "x" });
.lockscreen {
  position:fixed;
  top:0px;
  left:0px;
  width:100%;
  height:100%;
  background-color:rgba(89,54,158,1);
  background-image:url('../pics/wall.png');
  background-size:cover;
  background-position:center center;
}

.lockscreenFace {
  position:absolute;
  top:0px;
  left:1080px;
  width:1080px;
  height:1920px;
}

.lockscreenSlider {
  position:absolute;
  top:0px;
  left:-1080px;
  width:200%;
  height:100%;
}

.lockscreenClock {
  position:absolute;
  top:110px;
  left:0px;
  width:100%;
  height:300px;
  font-size: 296px;
  color:white;
  text-align:center;
}

.lockscreenDate {
  position:absolute;
  top:432px;
  left:0px;
  width:100%;
  height:80px;
  font-size: 60px;
  color:white;
  text-align:center;
}

.lockscreenSlideText {
  position:absolute;
  bottom:234px;
  left:0px;
  width:100%;
  height:80px;
  font-size: 80px;
  font-weight:bold;
  color:white;
  text-align:center;
  background:url('../pics/highlight.png');
  -webkit-animation: slidetounlock 3s infinite linear;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lockscreenSlideText:before {
  content: "\f105";
  font-family: FontAwesome;
  font-style: normal;
  font-weight: normal;
  font-size:85px;
  line-height:1;
  -webkit-font-smoothing: antialiased;
}

@-webkit-keyframes slidetounlock {
  0% {
    background-position: -880px 0;
  }
  100% {
    background-position: 0px 0;
  }
}
<div class="lockscreen">
  <div id="IDlsDragable" class="lockscreenSlider">
    <div class="lockscreenFace">
      <div id="IDlsClock" class="lockscreenClock">
        #TIME#
      </div>
      <div id="IDlsDate" class="lockscreenDate">
        #DATE#
      </div>
      <div class="lockscreenSlideText">
        slide to unlock
      </div>
      <div class="cameraGrabby">
      </div>
    </div>
  </div>
</div>

However, I'm experiencing a sudden jerk to the right when I start dragging the "lockscreenSlider" div to the right.

Answer №1

modify:size([parameter]);

this leads to problems with cursor alignment

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

Adding a loader to the specific button that has been clicked can be achieved by following these steps:

I am currently in the process of building an e-commerce platform website and I'm looking to implement a feature where users can add products to their cart with just a click of a button. However, before the product is added to the cart, I want to disp ...

Tips for refining a list to only include items that contain every element from a specified array

Is there a way to search for all elements in an array and display them if they are all present? For instance, consider the following: const data = [ { "languages": ["JavaScript"], "tools": ["React", "Sass"] }, { "languages": ["Python" ...

How can I simulate a callback function that was not tested?

Currently experimenting with the method below: startScriptLoad(): void { const documentDefaultView = this.getDocumentDefaultView(); if (documentDefaultView) { const twitterData: ICourseContentElementEmbedTweetWidgetData = this.getTwitterWid ...

What is the best way to swap out an icon based on the chosen option?

Here is my code: $('#mySelect').on('change', function() { var value = $(this).val(); $(".title").html(value); }) <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link href=" ...

Ways to efficiently incorporate data into App.vue from the constructor

My app initialization uses main.js in the following way, import App from './App.vue'; const store = { items: [{ todo: 'Clean Apartment.', },{ todo: 'Mow the lawn!', },{ todo: 'Pick up ...

Executing Multiple Requests Concurrently in Angular 5 using forkJoin Technique

Important Note The issue lies in the backend, not Angular. The requests are correct. In my Angular5 app, I am trying to upload multiple files at once using rxjs forkJoin. I store the requests in an array as shown in the code below. However, after adding ...

Issues arise when attempting to extract data from a data provider using JSON within the context of the Ionic framework

Hey there! I'm relatively new to the world of Angular and Ionic, and I've embarked on a project to create a pokedex app. My approach involves using a JSON file containing an array of "pocket monsters". However, my current challenge lies in extrac ...

Differences between Angular's $injector and Angular's dependency injectionAngular

As a newcomer to Angular, I am exploring the use of $injector and its get function to retrieve specific services. For instance: app.factory('$myService', function($injector) { return { ... var http = $injector.get('$http&apos ...

Spin the sphere texture in Three.js

Currently, I am working on rendering a sphere through three.js. While applying a texture to the sphere works well, I am having some difficulties rotating the texture to align it with marker positions. The issue arises when trying to place markers over Kag ...

Why are the radio buttons not aligned with the text in the center?

Currently, I am in the process of building a form that includes radio buttons. However, I've encountered an issue where the text next to the radio buttons appears on a different level than the buttons themselves. How can I go about fixing this partic ...

Troubleshooting PHP webpage with dysfunctional Python AJAX functionality

I have been working on developing a website that integrates with a python script to control GPIO pins on my Raspberry Pi. Unfortunately, I've encountered some issues with the code and need some assistance in troubleshooting. Could someone please revi ...

"Looking to retrieve data from an array instead of an object in JavaScript? Here's how you can

There is a slight issue with my fetch method in grabbing data from this link . I am attempting to use the .map function on it but instead of functioning properly, I encounter an error that says Unhandled Rejection (TypeError): jedis.map is not a function. ...

The keydown event is not functioning within the threejs canvas when OrbitControls are active

I am currently developing a threejs demo that contains several objects. One of my objectives is to create a form element positioned above the canvas, allowing users to input text. Background My approach involves dynamically generating a form using the fu ...

What is the best way to generate a new component by triggering an event with Vue.js?

Imagine you have a list of posts retrieved from an ajax response, and now you want to provide users with the option to edit any specific post by clicking a button. One approach could be using the v-show directive to attach a form component to each post. Wh ...

PHP captures the checkbox value through the $_POST method, whereas jQuery removes the checked class from it

I currently have a form with 2 checkboxes: Registered and Not Registered. If the Registered checkbox is ticked, then 2 additional options should appear: Active and Not Active. If the Registered checkbox is unticked, both the Active and Not Active options ...

"Learn the trick to replace the Ctrl + N shortcut in Firefox and initiate an AJAX request

Note: The answer provided by Juan Mendes has been selected as the best answer for my situation due to its usefulness. AxGryndr also offered valuable information, so I recommend reading both answers as they are beneficial in different scenarios. Thank you t ...

in javascript, how can you access the value of a parent object within a nested object?

Within the material ui framework, I am utilizing the createMuiTheme function to create a theme. How can I access the values of the parent object within a nested object? (I am aware that I can declare global variables above the function); To better unders ...

Issue: No default template engine specified and no file extension provided. (Using Express framework)

While I came across numerous questions with a similar title, they only provided me with partial help and did not completely resolve the error that plagued me. Just to provide some context, I had created a file named listing.js as a tool for running node c ...

Establishing flow types and generating unchangeable records

Looking to integrate Flow with Immutable.js Records, I've set up my record like this: const MyRecord = new Immutable.Record({id: undefined}) Now when I create records using new MyRecord({id: 1}), Flow gives me an error: constructor call Construct ...

A guide on incorporating a Java loop with Selenium automation

// Searching and deleting process driver.findElement(By.cssSelector("input[type='search']")).sendKeys("Diversification Rule Template"); driver.findElement(By.className("delete-template")).click(); Alert alert = driver.switchTo.alert(); Thread. ...