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 9087079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:38:05+00:00 2026-06-16T21:38:05+00:00

i have designed a slider like players volume sliders with jquery.but the problem is

  • 0

i have designed a slider like players volume sliders with jquery.but the problem is ONLY IN FIREFOX , first time when i drag slider it’s normal but second time browser drags that div it self like dragging images.unless after first time drag i click on an empty area and drag the slider again.what is the problem here?
sorry for my bad english.

EDIT :

http://codepen.io/anon/pen/bjChB

html:

<div id="btn_container">

    <div id="button"></div>

</div>

css:

div#btn_container{
width:200px;
height:60px;
position:absolute;
background:red;
margin:auto;
right:0;left:0;top:0;bottom:0;  
}
div#button{
width:60px;
height:60px;
background:blue;
position:absolute;
left:0px;top:0px;   
}

jquery:

$(document).ready(function() {
    var pressed = false;
    var $this;
    var x;
    $("div#button").mousedown(function(e){
        pressed = true;
        $this = $(this);
        var offset = $this.offset();
        var inside = e.pageX - offset.left;
        $(document).mousemove(function(e){
            if(pressed){
                var parentOffset = $this.parent().offset();
                x = e.pageX - parentOffset.left;
                if( x <= $this.parent().width() - $this.width() + inside && x >= 0 + inside)
                    $this.css({"left":x - inside});
            }
        });
    });
    $(document).mouseup(function(){
        if(pressed){
            if( x > $this.parent().width() - $this.width() - 30)
                $this.animate({"left":$this.parent().width() - $this.width()} , 50);

            pressed = false;
        }
    });

});
  • 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-16T21:38:06+00:00Added an answer on June 16, 2026 at 9:38 pm

    You can add e.preventDefault(); to your mousedown to prevent whatever behavior it is that firefox is trying to use.

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

Sidebar

Related Questions

I have designed a custom section handler before but I'm faced with a problem
I have designed many web-templates. But (except my first one) I've never used browser
SLIDER CODE http://tympanus.net/codrops/2012/03/15/parallax-content-slider-with-css3-and-jquery/ IMAGE MOCK: I'd like to preface this by saying I'm not
I have designed a 2-Level CSS drop down menu. Everything works perfect except only
I have designed a report with 4 subreports, the problem is that when I
I have designed a custom Windows application in C#. Now, I would like to
I have to scrape 1000 links that are simmilar in structure but only differ
I have designed a simple gui in netbeans on windows but when i try
I have designed my database structure, like below to support the creation of multiple
I have designed a simple website. The only thing left is to make a

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.