fbpx

An Exclusive Offer For You To Grab JD Builder ProCheck Deal of The Day

Welcome, Guest
Username: Password: Remember me

Building something on Astroid?

Submit your site to be featured in our monthly Astroid Site Showcase!

Submit Now

TOPIC: How to add a script to the page?

How to add a script to the page? 1 week 6 days ago #18458

  • graf_in
  • graf_in's Avatar
  • Offline
  • New Member
  • Posts: 6
  • Karma: 0
How to add a script to the page?
If I paste the code in options - advanced - custom code - js
<script>
jQuery(function($){
$('a[href*="#"]').on('click.smoothscroll', function( e ){
var hash    = this.hash, _hash   = hash.replace(/#/,''), theHref = $(this).attr('href').replace(/#.*/, '');
if( theHref && location.href.replace(/#.*/,'') != theHref ) return;
var $target = _hash === '' ? $('body') : $( hash + ', a[name="'+ _hash +'"]').first();
if( ! $target.length ) return;
e.preventDefault();
$('html, body').stop().animate({ scrollTop: $target.offset().top - 0 }, 400, 'swing', function(){
window.location.hash = hash;
});
});
});
</script>

does not work
The administrator has disabled public write access.

How to add a script to the page? 1 week 6 days ago #18464

  • chandandeep
  • chandandeep's Avatar
  • Offline
  • Administrator
  • Posts: 3150
  • Thank you received: 496
  • Karma: 83
Go to Page Settings and in the Advanced tab you get the JavaScript editor. Please save your code there without <script> tag.

Thanks,
Chandan
Attachments:
Thank You,
If you like our support and products, tweet us at joomdev and let the world know about it.

To know more about products check out the their documentation.
The administrator has disabled public write access.

How to add a script to the page? 1 week 6 days ago #18474

  • graf_in
  • graf_in's Avatar
  • Offline
  • New Member
  • Posts: 6
  • Karma: 0
I do not understand.
I do as you say and paste this code without the <script> tag in the page options. Nothing works.

If you paste the same script into Raw HTML with the <script> tag, everything works.

veloprokatik.com/remont/remont-velosipedov
сейчас код вставлен и в страницу и в Raw HTML, но если посмотреть код страницы, видно только в Raw HTML
But now the accordion has stopped working. (throws to the top of the page)
Last Edit: 1 week 5 days ago by graf_in.
The administrator has disabled public write access.

How to add a script to the page? 1 week 5 days ago #18483

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Posts: 3064
  • Thank you received: 464
  • Karma: 100
Hello,

It could be the placement of the javascript that's not making it work.

If you insert the javascript and see if on the place, that means the builder is properly adding JS to your page. Why it's not working is beyond our support scope.

Thanks,
Chetan
Thank You,
If you like our support and products, tweet us at joomdev and let the world know about it.
The administrator has disabled public write access.
Moderators: chandandeep
Time to create page: 0.244 seconds