test
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • carlo85 Friend
    #199460

    Dear forum,
    I would like to add simple javascript code to the articles (to enable smooth scrolling) I’ve followed different guides, but nothing seems to work 🙁

    Any suggestions?

    the code:
    $(function() {
    $(‘a:not()’).click(function() {
    if (location.pathname.replace(/^//,”) == this.pathname.replace(/^//,”) && location.hostname == this.hostname) {
    var target = $(this.hash);
    target = target.length ? target : $(‘[name=’ + this.hash.slice(1) +’]’);
    if (target.length) {
    $(‘html,body’).animate({
    scrollTop: target.offset().top
    }, 1000);
    return false;
    }
    }
    });
    });

    alexsmirnov Friend
    #541289

    Hi Carlo,

    To easily embed JavaScript or PHP code inside Joomla’s articles or modules, please use one of the extensions, listed at http://extensions.joomla.org/extensions/core-enhancements/coding-a-scripts-integration/custom-code-in-content.

    As far as your JS code is concerned, according to our Support Policy, JoomlArt support staff may consider offering you some limited help with your code only when you become our subscribed customer.

    Regards,

    Alex

    carlo85 Friend
    #541378

    Thanks!! 😀 That was exactly what I needed!

    The js code was already working!

    <em>@alexsmirnov 435377 wrote:</em><blockquote>Hi Carlo,

    To easily embed JavaScript or PHP code inside Joomla’s articles or modules, please use one of the extensions, listed at http://extensions.joomla.org/extensions/core-enhancements/coding-a-scripts-integration/custom-code-in-content.

    As far as your JS code is concerned, according to our Support Policy, JoomlArt support staff may consider offering you some limited help with your code only when you become our subscribed customer.

    Regards,

    Alex</blockquote>

Viewing 3 posts - 1 through 3 (of 3 total)

This topic contains 3 replies, has 2 voices, and was last updated by  carlo85 10 years, 5 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum