"Kundan Singh Chouhan" assisted me in resolving a problem a few weeks back: How to call a CSS file using JQuery .append() and delete it on the second click
However, the issue has since become more complex. I now aim to incorporate our ancient script, "Rovás," into the website: Visit Jakabszallas.hu
The challenge lies in not being able to simply use font-face CSS due to specific characters like "dzs, cs, gy, ty" having unique representations in Rovás writing. Consequently, these characters do not align with their Latin counterparts on the keyboard.
This led to the creation of a custom JavaScript solution: Explore Rovásmag
Currently, I am implementing this by triggering it through a link on the site's top-right corner, similar to how I previously used font-face.
This is the relevant link:
<li class="skip-link-rovas"><a class="assistive-text" href="#" accesskey="7">Toggle Rovás</a></li>
At the bottom of my site, you will find the following JavaScript code:
<script src="http://jakabszallas.hu/wp-content/themes/jakabszallasv2/js/rovasmag.js" type="text/javascript"></script><!-- Rovas -->
<script src="http://jakabszallas.hu/wp-content/themes/jakabszallasv2/js/scripts.js" type="text/javascript"></script><!-- Additional scripts -->
Within the scripts.js file, there are two JQuery scripts present:
// JQuery CSS switcher (Rovás)
$(document).ready(function() {
$(".skip-link-rovas").click(function(){
if($(this).find("link").length <= 0)
$(this).append('<link rel="stylesheet" type="text/css" media="all" href="http://jakabszallas.hu/wp-content/themes/jakabszallasv2/css/rovas.css" />');
else
$(this).find("link").remove();
});
});
$(document).ready(function() {
$('.skip-link-rovas').click(function(){
rovasmag_atro();
});
});
The function"rovasmag_atro();" triggers the "rovasmag.js" script, converting all text to Rovás script and changing the writing direction from right to left. It is crucial for displaying the correct characters for "dzs, cs, gy, ty" letters in the Rovás font.
As someone unfamiliar with JavaScript programming, my question remains: Is there a way to integrate "rovasmag_atro()" into the aforementioned script that calls the CSS file and toggles it off on the second click?