I am creating an Android application based on web browsing in which I need to display html, for example on an e-book page, so I have to use web browsing because I need to change the title of the content link to view this link while scrolling through the headers http://jsfiddle.net/kd6Y4/10/show/
how can I paginate it, please help me with the code here jsfiddle link http://jsfiddle.net/kd6Y4/10/
js code am is used to read the header and add highlighting in an e-book: -
$(window).scroll(function() {
var winTop = $(this).scrollTop();
var divs = $('div');
var top = $.grep(divs, function(item) {
return $(item).position().top <= winTop;
});
var ll=$(top);
$(top).each(function(i, item) {
var total=ll.length-1;
if(total==i)
{
$("#finalvalue1").empty();
document.title=$(item).attr("id");
}
});
});
function createListener1(){
document.addEventListener('click', function(event){
var element=event.target;
if(element!==document.body){
if(element.className==='vs'){
element.className='highlight1';
} else if(element.className==='highlight1') {
element.className='vs';
}
}
}, false);
}
function createListener2(){
document.addEventListener('click', function(event){
var element=event.target;
if(element!==document.body){
if(element.className==='vs'){
element.className='highlight2';
} else if(element.className==='highlight2') {
element.className='vs';
}
}
}, false);
}
function createListener3(){
document.addEventListener('click', function(event){
var element=event.target;
if(element!==document.body){
if(element.className==='vs'){
element.className='highlight3';
} else if(element.className==='highlight3') {
element.className='vs';
}
}
}, false);
}