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

How to make other links run #107

Open
deliriouser opened this issue Dec 20, 2012 · 1 comment
Open

How to make other links run #107

deliriouser opened this issue Dec 20, 2012 · 1 comment

Comments

@deliriouser
Copy link

Hi all, i just build site here http://www.newlaunchvista.com/
I use MovingBoxes script on Hot Project Section.
My question is, how to make the img and title clickable goes to the link provide
For now the links click cause slide to the right or left except the center images.

Many Thanks

@Mottie
Copy link
Contributor

Mottie commented Dec 20, 2012

It's not perfect, but try this code (demo)

$('#slider').movingBoxes({
    buildNav: true,
    navFormatter: function(index, panel){ return "●" },
    initialized: function(e, slider, tar){
        slider.$panels.find('a').bind('click', function(){
            window.location.href = $(this).attr('href');
        });
    }
});

If that's not satisfactory, you can remove or comment out lines 60-65 of the jquery.movingBoxes.js file:

/* lines 60-65 -> remove these
base.$el.delegate('.mb-panel', 'click', function(e){
    if (!$(this).hasClass(o.currentPanel)) {
        e.preventDefault();  // prevent non-current panel links from working
        base.change( base.$panels.index($(this)) + base.adj, {}, true );
    }
});
*/

I'll probably need to add an option to make those links clickable, or not.

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