[BBCode] Go to mark points Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

    [BBCode] Go to mark points

    jackauk
    jackauk
    New Member


    Posts : 2
    Reputation : 2
    Language : English, Vietnamese

    [BBCode] Go to mark points Empty [BBCode] Go to mark points

    Post by jackauk Tue 28 Jun 2016, 17:02

    this BBcode help everyone can view topic easier via markPoint if the post is too long to scroll exactly.

    BBCode:

    1. Create mark point

    BBCode: [markP=<number>] anchor [/markP]


    actionscript: ACP>Modules>HTML&JavaScript> JavaScript codes Management

    Code:
    /***

    * Date: 26/06/2016
    * Author: jackauk

    ***/
    jQuery(document).ready(function($) {
     
     var jContent = $('.postbody, .blog_message');
        jContent.html(function() {
                  return $(this)
                  .html()
                  .replace(/\[markP=(.*?)\](.*?)\[\/markP\]/g,'<p id="$1">$2</p>');
        });
     
    });


    1. Go to mark point

    BBCode: [GoTo=<number>] anchor [/GoTo]

    javascript: ACP>Modules>HTML&JavaScript> JavaScript codes Management

    Code:
    /***

    * Date: 26/06/2016
    * Author: jackauk

    ***/
     


    jQuery(document).ready(function($) {

     
     var jContent = $('.postbody, .blog_message');

     
        jContent.html(function() {
                  return $(this)
                  .html()
                  .replace(/\[GoTo=(.*?)\](.*?)\[\/GoTo\]/g,'<p id="g$1">$2</p>');
        });
    $('p').click(function() {
     


    var address_origin = $(this).attr("id");
       if (address_origin.indexOf("g")==0)
       {

          var  address = '#'+ $(this).attr("id").replace('g','');
          $(document.body).animate({ 'scrollTop':  $(address).offset().top}, 1000);
       }

    });
    });


     function gotoMark(GAL) {
            var address_origin = $(this).attr("id");
       if (address_origin.indexOf("g")==0)
       {
          var  address = '#'+ $(this).attr("id").replace('g','');
          $(document.body).animate({ 'scrollTop':  $(address).offset().top}, 1000);
       }
     }