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

clicking images to relocate to given URL #6

Open
nxthor opened this issue Jun 16, 2015 · 1 comment
Open

clicking images to relocate to given URL #6

nxthor opened this issue Jun 16, 2015 · 1 comment

Comments

@nxthor
Copy link

nxthor commented Jun 16, 2015

Hi there!
Is there currently any way through hooks or config to have the carousel redirect the location to a given URL when clicking one image out of the list?

I nested the images in <a/> tags, but the click events on them are caught somewhere else I guess.
If I call the .click() of an img or link from console it works.

Is there a possible fast hack to get there? Found nothing in the code yet.

@pushpendraas400
Copy link
Owner

Hi :
You can wrap images inside an anchor tag like this:

<div id="fruits">
            <ul>
        <li><a href="http://yahoo.com"><img src="images/fruits1.jpg" /></a></li>
        <li><a href="http://google.com"><img src="images/fruits2.jpg" /></a></li>
        <li><a href="http://yahoo.com"><img src="images/fruits3.jpg" /></a></li>
        <li><a href="http://google.com"><img src="images/fruits4.jpg" /></a></li>
</ul>
</div>

and comment out following section of code inside tiksluscarousel.js lines 693 through 706

/* slide on image click */
                carousel.find(".tslider").click(function(e) {
                var half=carousel.width()/2;
                if(e.pageX<=half){
                if(options.current>1){
                obj.scrollTo(options.current-1);
                }
                }
                if(e.pageX>=half){
                   if (options.current < count) {
                obj.scrollTo(options.current+1);
                        }
                    }
            });

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

No branches or pull requests

2 participants