0
User fills in a form and clicks to register. The system opens a modal window with the "agree" button disabled. Only by scrolling the scroll bar to the end is the button enabled to register. By the mouse scroll or touchpad everything works but by clicking on the bar and scrolling to the end, the button is not triggered. It’s a code that runs inside the WP.
Follows the code:
<div id="popup" class="popup-content">
<div class="popup-inner" style="padding:20px;">
<p>
Por favor, solicitamos que leia o contrato até o final antes de clicar em aceitar, obrigado.
</p>
<div class="termos form--termos" id="termos" name="termos" style="height: 200px;overflow: scroll;background: #f2f2f2;margin-bottom: 10px;padding: 10px;">
bla bla bla bla bla
</div>
<a href="recusa" class="button button_large">
<span style="padding: 15px 30px;font-size: 110%;line-height: 110%;">Não aceito</span>
</a>
<button type="submit" class="button button_large form--btn-cadastro" >
<span class="button_label" style="padding: 15px 30px;font-size: 110%;line-height: 110%;">Concordo</span>
</button>
<hr class="no_line" style="margin: 0 auto 20px;">
</div>
</div>
JS:
var $j = jQuery.noConflict();
$j(document).ready(function() {
var mousewheelevt = (/Firefox/i.test(navigator.userAgent)) ? "DOMMouseScroll" : "mousewheel";
$j(".termos").live(mousewheelevt, function(e){
if($j(this).scrollTop() + $j(this).innerHeight() >= $j(this)[0].scrollHeight) {
$j('.form--btn-cadastro').attr('disabled', false).css('opacity', '1');
}
$j(".form--btn-cadastro").click(function() {
$j("#form_cadastro").submit();
});
});
How to enable the button by scrolling the bar as well? Using version 1.12.4 of Jquery.