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

Go down

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

Post by jackauk June 28th 2016, 6:02 pm

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);
   }
 }
jackauk
jackauk
New Member

Posts : 2
Reputation : 2
Language : English, Vietnamese

http://openlab.forumvi.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum