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

Link in item confused navigation #821

Open
rolandow opened this issue May 31, 2017 · 1 comment
Open

Link in item confused navigation #821

rolandow opened this issue May 31, 2017 · 1 comment

Comments

@rolandow
Copy link

rolandow commented May 31, 2017

I have some text in my li items (not just links with pictures). Now when I use a link in this text, the next button thinks that this is an image too; but it can't find the image and the ajax loader is shown. So instead of three images, the carousel thinks there are four images with the code I will post below.

When I remove the link from the first post, the carousel works perfectly.

I thought I could fix this by using the items selector as stated in the manual. So I tried

jQuery(document).ready(function() {
    jQuery('.mycarousel').jcarousel({
        scroll:1,
        wrap:"both",
        items: ".carousel-item"
    });
});

But this didn't help. My list looks like this:

<ul class="mycarousel thumbs" data-gallery="one">
    <li class="item">
        <figure><a href="/files/2017-04/boot-hotels-terschelling.jpg?05f7f4b668" class="carousel-item"><div class="icon-hover" ></div><img src="/thumbs/about/2017-04/boot-hotels-terschelling.jpg?_locale=nl" class="scale-with-grid" alt=""/></a></figure>
        <div class="spacer-2">
            <h3>Reis <span>veerboot</span></h3>
            <p>Uw reis van en naar het eiland Terschelling gaat met een veerboot vanuit Harlingen.</p>

            <p><a href="http://www.google.com">www.google.com</a></p>

        </div>
    </li>

                                
    <li class="item">
        <figure><a href="/files/2017-04/jong-holland-huis-rotated.jpg?d250fcac99" class="carousel-item"><div class="icon-hover" ></div><img src="/thumbs/about/2017-04/jong-holland-huis-rotated.jpg?_locale=nl" class="scale-with-grid" alt=""/></a></figure>
        <div class="spacer-2">
            <h3>Verblijf <span>op uw duin</span></h3>
            <p>lorem ipsum</p>

        </div>
    </li>

                                
    <li class="item">
        <figure><a href="/files/2017-04/jong-holland-terrassen-2-.jpg?111703e1a7" class="carousel-item"><div class="icon-hover" ></div><img src="/thumbs/about/2017-04/jong-holland-terrassen-2-.jpg?_locale=nl" class="scale-with-grid" alt=""/></a></figure>
        <div class="spacer-2">
            <h3>Zon <span>terras</span></h3>
            <p>lorem ipsum</p>

        </div>
    </li>
</ul>
@snake-345
Copy link
Collaborator

snake-345 commented May 31, 2017

You don't have the correct markup. Just try:

jQuery(document).ready(function() {
    jQuery('.mycarousel').jcarousel({
        scroll:1,
        wrap:"both",
        items: ".item"
    });
});

and markup:

<div class="mycarousel thumbs" data-gallery="one">
    <ul>
        <li class="item">
            <figure><a href="/files/2017-04/boot-hotels-terschelling.jpg?05f7f4b668" class="carousel-item"><div class="icon-hover" ></div><img src="/thumbs/about/2017-04/boot-hotels-terschelling.jpg?_locale=nl" class="scale-with-grid" alt=""/></a></figure>
            <div class="spacer-2">
                <h3>Reis <span>veerboot</span></h3>
                <p>Uw reis van en naar het eiland Terschelling gaat met een veerboot vanuit Harlingen.</p>

                <p><a href="http://www.google.com">www.google.com</a></p>

            </div>
        </li>

                                    
        <li class="item">
            <figure><a href="/files/2017-04/jong-holland-huis-rotated.jpg?d250fcac99" class="carousel-item"><div class="icon-hover" ></div><img src="/thumbs/about/2017-04/jong-holland-huis-rotated.jpg?_locale=nl" class="scale-with-grid" alt=""/></a></figure>
            <div class="spacer-2">
                <h3>Verblijf <span>op uw duin</span></h3>
                <p>lorem ipsum</p>

            </div>
        </li>

                                    
        <li class="item">
            <figure><a href="/files/2017-04/jong-holland-terrassen-2-.jpg?111703e1a7" class="carousel-item"><div class="icon-hover" ></div><img src="/thumbs/about/2017-04/jong-holland-terrassen-2-.jpg?_locale=nl" class="scale-with-grid" alt=""/></a></figure>
            <div class="spacer-2">
                <h3>Zon <span>terras</span></h3>
                <p>lorem ipsum</p>

            </div>
        </li>
    </ul>
</div>

And don't forgive some styles. You can find instruction about simple installation here

If you need more help please add a sample code in jsfiddle.

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