Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make only selected slide link clicable #36

Closed
eXXon48 opened this issue Aug 31, 2011 · 4 comments
Closed

make only selected slide link clicable #36

eXXon48 opened this issue Aug 31, 2011 · 4 comments

Comments

@eXXon48
Copy link

eXXon48 commented Aug 31, 2011

all that I need to do its make links in the slides unclicable until the slide became selected
i try something like this

$("#slider li").not(".current").find("a").live("click",function(event){event.preventDefault();});

but this don't work

also i find out that when i clear cashe slider stops on first slide and buttons don't work, but when i click on left or right slide it sliding out as usual

@Mottie
Copy link
Contributor

Mottie commented Aug 31, 2011

Try this (demo):

$("#slider a").bind("click",function(event){
    if ($(this).closest('.mb-panel').is('.current')) {
        // allow click
        return;
    } else {
        // prevent link from working - click still switches panels.
        event.preventDefault();
    }
});

@eXXon48
Copy link
Author

eXXon48 commented Aug 31, 2011

about buttons all works fine, just update jquery to latest version also updated moving boxes to latest

but still cant prevent click function on links that not in current page (slide)

@eXXon48
Copy link
Author

eXXon48 commented Aug 31, 2011

Thank you very much for your quick response, now it works as it should

also, if you using ajax load content into moving boxes its better to chose live() instead bind()
$("#slider a").live("click",function(event){
..............
});

@eXXon48 eXXon48 closed this as completed Aug 31, 2011
@Mottie
Copy link
Contributor

Mottie commented Jan 10, 2012

Update: This should no longer be an issue in version 2.2.3+.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants