framework7
framework7 copied to clipboard
event scroll not work
How to apply if an element is visible scrolling?
this my code
$$(document).on('scroll', '.page-content', function()
{
console.log('scroll');
});
this my only solution using Vanilla http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onscroll
//al cargar la vista de las evaluaciones activas
myApp.onPageInit('evaluaciones_p', function (page)
{
var zona_div = document.getElementById("pagina_scrollA");
zona_div.addEventListener('scroll', function()
{
scrolleando();
}, false);
});
myApp.scrolleando = function()
{
var $elem = $('#item_element');
var $window = $(window);
var docViewTop = $window.scrollTop();
var docViewBottom = docViewTop + $window.height();
var elemTop = $elem.offset().top;
var elemBottom = elemTop + $elem.height();
console.log( ((elemBottom <= docViewBottom) && (elemTop >= docViewTop)) );
};
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.