Thank you for bringing that to my attention. Please try v4.1. Does this work?
Feedback would be great. And a review if it works. =)
Thanks for your prompt reply
I was thinking of making changes to the plugin, which fortunately you did well
This issue was resolved with the update
thank you
There is another problem
I use the following code to get the target ID
$(document).on('click', 'a[href^="#"]', function(e) {
var id = $(this).attr('href');
var $id = $(id);
if ($id.length === 0) { return; }
e.preventDefault();
var pos = $id.offset().top - 50 ;
$('body, html').animate({scrollTop: pos});
});
But if the href
and target id
is Persian, it will not work anymore
It may be best to set a condition that the number be used for the element if it were not English letters
somethings like
<a href="toc-1">عنوان</a>
<a href="toc-2">عنوان</a>
<h2 id="toc-1">عنوان<h2>
<h2 id="toc-2">عنوان<h2>
Of course, this is a suggestion
And maybe adding smooth scroll to ID
will help make the plugin more advanced
-
This reply was modified 3 years, 3 months ago by Asadiyan.
Ok. I think it might be better for the resulting urls to reflect the content of the anchor in the url.
blabla.com/my-fav-games#dark-souls1
is better than
blabla.com/my-fav-games#toc-1
That applies to Arabian language, too.
And SimpleTOC is not AdvancedTOC. It’s simple. No JS, No CSS. There are other plugins that do that. SimpleTOC will remain simple. Especially in the frontend. Personally, I am annoyed by websites that override basic browser functionality like fast anchor tag links.
You can count the elements in the toc and then jump to their corresponding headline if you really need to and use numbers yourself.
I think this topic is resolved. Feel free to open another one!
Thanks for the reply.
Do you allow me to customize this plugin?
I would like to ask your permission first, because of your copyright and your efforts
It is on GitHub and here. Of course.