Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8124651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:31:33+00:00 2026-06-06T06:31:33+00:00

My problem : I need to create draggable widgets (here it’s a jslider for

  • 0

My problem : I need to create draggable widgets (here it’s a jslider for example) from outside the iframe. Both Container and iframe content are from the same origin.
The problem is that jQuery is attaching the mousemove event on the wrong document object.

http://jsfiddle.net/techunter/4pnxh

Try moving the sliders, it can only move when the mouse trigger the events outside the iframe.
Please help, I’m stuck here

EDIT:
JQuery listens to the click on the slider handle and on click event it create a new listener on mousemove but within the window, not the frame. I’m considering changing the jquery lib and adding a context (which by default is window.document) but it’s time expensive.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T06:31:35+00:00Added an answer on June 6, 2026 at 6:31 am

    A Work arround for this is:

    • As the slider is actually not working by default just don’t call anything at start

    • Create a JavaScript function that will set the value of the slider while the mouse is being held down inside the slider.

    • You need to make the ui-slide-handle return a reference to its parent while is being helddown

    This solution works in all major browsers:

    $(function(){
    
      $('iframe').ready(function(){
         var $document = $('#result iframe',$('#main').contents()).contents();
         $('.slider',$document).slider({
              //Prevent the slider from doing anything from the start
              start:function(event,ui){return false;}
         });
    
    
         $(document).mouseup(function(){
             $('.slider,.ui-slider-handle',$document).unbind('mousemove') 
         })
    
         //While the ui-slider-handle is being held down reference it parent.
         $('.ui-slider-handle',$document).mousedown(function(e){
            e.preventDefault();
            return $(this).parent().mousedown()})
    
         //This will prevent the slider from moving if the mouse is taken out of the
         //slider area before the mouse down has been released.                
         $('.slider',$document).hover(function(){
    
            $('.slider',$document).mousedown(function(){
               $(this).bind('mousemove',function(e){
    
                    //calculate the correct position of the slider set the value
                    $(this).slider('value',e.pageX*100/$(this).width())
               });             
            }).mouseup(function(){
                 $(this).unbind('mousemove');
            })},function(){
            $( '.slider',$document ).unbind('mousemove'); 
         })          
        })
        });
    

    The solution link:

    Solution

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the whole problem: I need to create a plain csv table from a
Here is my problem: I need to create an interface, where a user could
I need to create class Dog and PurebredDog extending Dog. Problem is that Dog
Problem: I need to write/read objects from a file.This because I need to write/read
I faced a problem - I need to use a macro value both as
I have problem i need to convert from my Array structure to std::vector<int> ...
The problem is that I need to create in runtime a class like this:
i have a problem. I need to create pure diagram for my project (Django).
I have a problem I need to create table in database SQLite in Android
Problem I need to create 32 Bit numbers (signed or unsigned doesn't matter, the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.