The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

[BBCode] Go to mark points

View previous topic View next topic Go down

[BBCode] Go to mark points

Post by jackauk on 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
New Member

Posts : 1
Reputation : 2
Language : English, Vietnamese

http://openlab.forumvi.com

Back to top Go down

View previous topic View next topic Back to top


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