Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

deferClick problem #65

Closed
dave0783 opened this Issue · 5 comments

4 participants

David Meyers Rob wartual Jonathan Azoff
David Meyers

Recently I implemented this plugin and had great success. However, one of my coworkers was QA'ing our site and noticed a bug that I cannot seem to figure out. Occasionally when you click on a link in the scrollable area and drag, the deferClick function does not seem to function as expected. Sometimes the link click event is deferred, sometimes the actual link is followed, sometimes the click event is fired, and sometimes the mouse sticks to the link.

Here is my document.ready function:

$(function(){
    $('a.click').click(function(e){
        console.log('hello');        
        return false;
    });
    $("#overscroll").overscroll({
        dragHold:true,
        direction:'vertical',
        hoverThumbs:true
    });
});

here is the CSS:

<style>
    #overscroll {
        margin:0 auto;
        width:900px;
        height:600px;
        overflow: hidden;
        border: 1px solid;
    }
</style>

Here is the HTML:

<div id="overscroll">
    <?php foreach (range(0, 10) as $n): ?>
        <div class="box">
            <a href="http://www.google.com" class="click" target="_blank">This is a test Link</a>
            <p>
                Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore
                et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
                aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
                cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,
                sunt in culpa qui officia deserunt mollit anim id est laborum.
            </p>                
        </div>
    <?php endforeach ?>
</div>

Steps to reproduce the issue:
1. After page loads, click the second "This is a test Link" and drag up (Mouse must stay over the link text)
2. Release your mouse. http://www.google.com will now open.
3. Navigate back to your test page.
4. Find the same link and drag down (Make sure mouse stays over the link text)
5. Release your mouse. Your mouse is now stuck to the scroller and you must click again to release it.

Edit: I am using jQuery 1.7.2 and reproduce this in Firefox 14.0.1, Google Chrome 21.0.1180.75 m, and IE 9; however, the sticking mouse issue does not seem to be an issue in IE 9

wartual

I'm having the same issue...Does anybody know how to solve this?

Jonathan Azoff
Owner

Hello,

Sorry for the late reply, I've been traveling and haven't had a moment to look at any bugs. I plan on getting to these eventually when I get a moment but any pull requests will be considered if you decide to take initiative on this.

Best,

Jon

wartual

Hello,
it's me again. I'm having the same problem in another use-case: i have one placeholder on which i activate oversroll.js.On this placeholder i have bunch of boxes which can be edited when users click on pencil image. When the image is clicked, another div pops up from this box where user can select value for that box. Problem is when you click on the pencil image, deferClick() function doesn't occur and i can overscroll the entire placeholder without holding down mouse button. When user closes the pop up div, overscroll starts to work properly.

Any suggestions?

Best,
Wartual

Jonathan Azoff
Owner

@wartual please do not piggy back on this issue. Please create a new issue with a jsfiddle link or demo on how to reproduce your issue.

@rspenc29 thanks for the fiddle, I'll take a look.

Jonathan Azoff azoff closed this in b7d81c1
Jonathan Azoff azoff referenced this issue from a commit
Jonathan Azoff v1.6.4 Release
spaces to tabs
fixed deferClick bug. Closes #65
spaces to tabs
Allow scrollOffset options for touchscroll. #72
Default cancelOn is select, textarea, and input. #70
Prepare for release.
77182a3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.