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

multiple carousels one page need different param settings #87

Open
laredo4538 opened this issue Jun 24, 2015 · 1 comment
Open

multiple carousels one page need different param settings #87

laredo4538 opened this issue Jun 24, 2015 · 1 comment

Comments

@laredo4538
Copy link

Is it possible to setup echo.js to apply different options per element within one page? For instance I have a small carousel near the top of the page and a slider near the bottom of the page that is the width of the entire page. I want to apply different echo options to these separate features. Is this possible and if so how do I execute? Thanks for any suggestions!

@ljluestc
Copy link

ljluestc commented Dec 2, 2023

<!-- Initialize Echo.js with common options -->
<script>
    echo.init({
        offset: 100,
        throttle: 250,
        unload: false,
        callback: function(element, op) {
            // Common callback logic here
        }
    });
</script>

<!-- First Carousel with custom options -->
<div class="carousel" data-echo="img/carousel1.jpg" data-echo-options='{ "offset": 50, "throttle": 100 }'>
    <!-- Carousel content -->
</div>

<!-- Second Carousel with different custom options -->
<div class="carousel" data-echo="img/carousel2.jpg" data-echo-options='{ "offset": 75, "throttle": 200 }'>
    <!-- Carousel content -->
</div>

<!-- Third Carousel with its own custom options -->
<div class="carousel" data-echo="img/carousel3.jpg" data-echo-options='{ "offset": 60, "throttle": 150 }'>
    <!-- Carousel content -->
</div>

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