Friday, June 9, 2017

How to include custom js code in joomla


/layouts/template.php in your template

 <?php
  // bing add this 20170609
   $document = JFactory::getDocument();
   $document->addScript('templates/fontaine_j3/js/custom.js');
  ?>

custom.js code

/* Bing added it in 20170421 to get horizontal display */
var $ = jQuery.noConflict();
  $(document).ready(function() {
    window.onload = function () {
    $('#toTop').css("cssText", "text-transform: none !important;");
     $('#toTop').text('Retour en haut');
     // console.log('set the value to it');
    }
 });

No comments:

Post a Comment