Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

227
Views
¿Cómo guardar la posición de la imagen arrastrada como foto de portada de Facebook?

¿Cómo podría guardar la imagen arrastrada en javascript? ¿Hay algo diferente en el código con respecto a la posición en él? Cualquier ayuda sería apreciada...

 var imgWidth; var imgHeight; var img = new Image(); img.src = 'https://picsum.photos/860/550/?image=316'; $(img).on('load', function() { imgWidth = img.width; imgHeight = img.height; $('#image').css('background-image', 'url(' + img.src + ')'); }); var start_y; var newPos; var curPos = $('#image').css('background-position-y'); var mouseDown = false; var move = true; $('#image').mousedown( function(e) { mouseDown = true; }); $(document).mouseup( function() { mouseDown = false; $('.image').css('background-position-y', curPos) }); $('#image').mouseenter( function(e) { start_y = e.clientY; }); $(document).mousemove( function(e) { newPos = e.clientY - start_y; start_y = e.clientY;
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <div id="image"></div> <button type="button" id="save" class="modal-add-btn">Save</button>

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!