Support » Plugin: Reading Position Indicator » How to make this plugin smarter

  • Resolved


    #1 Great work!
    #2 Let me show you how Reading Position Indicator can indicate only text area progress, no full page progress. In this way when you finish reading post, the indicator will show 100%, ignoring comments, Shareaholic stuff an so.

    First, we have to insert an invisible marker into posts right after the text area. For this add those lines in file: reading-position-indicator/reading-position-indicator.php

    function iworks_insert_end_reading_position($content) {
        return $content . "<div id=\"end_reading_position\"></div>";
    add_filter( 'the_content', 'iworks_insert_end_reading_position', 1 );

    Then, change just one line in file: reading-position-indicator/scripts/iworks_position.js

    var getMax = function(){
                //return $(document).height() - $(window).height();
    	    return $("#end_reading_position").offset().top - $(window).height(); //JUNIOR

    HAVE FUN! 😉

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to make this plugin smarter’ is closed to new replies.