zurb / twentytwenty

jQuery Plugin to Compare Images
ISC License
1.27k stars 295 forks source link

Overlay option being ignored if overlay is hardcoded #92

Closed ghost closed 6 years ago

ghost commented 6 years ago

I want to change the 'After' overlay label to make use of PHP variables, so I set no_overlay to true, and then hardcode my overlay in the HTML markup as this:

<div class="twentytwenty-overlay">
    <div class="twentytwenty-before-label" data-content="Before"></div>
    <div class="twentytwenty-after-label" data-content="After <?php echo $duration; ?>"></div>
</div>

However, because of this I now get two instances of the overlay displayed, the normal one, and my hardcoded one. I see this is because it is looking for the div with class twentytwenty-overlay, regardless of the option set.

I should be allowed to disable the default overlay, and show my hardcoded one surely?

ghost commented 6 years ago

Have added a pull-request to fix this #93

raphaeleidus commented 6 years ago

thank you for the PR