Title: Appointments Plugin javascript conflict with theme
Last modified: December 21, 2017

---

# Appointments Plugin javascript conflict with theme

 *  [shinjaykagawa](https://wordpress.org/support/users/shinjaykagawa/)
 * (@shinjaykagawa)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/appointments-plugin-javascript-conflict-with-theme/)
 * Hi
 * I have been using the Moesia theme for a while now and a wanted to use an appointments
   plugin. The best plugin we found was this one: [Appointments](https://wordpress.org/plugins/appointments/)
   
   The problem is that the next month / previous month buttons don’t work as the
   theme has some conflicting javascript not allowing it to function.
 * Here was my post on the plugin support forum where I was advised to ask here:
   [link](https://wordpress.org/support/topic/next-month-previous-month-button-doesnt-work/#post-9802668)
 * Can you help me with this please?
 * Thanks in advance
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fappointments-plugin-javascript-conflict-with-theme%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  [Kharis Sulistiyono](https://wordpress.org/support/users/kharisblank/)
 * (@kharisblank)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/appointments-plugin-javascript-conflict-with-theme/#post-9807635)
 * Hello there,
 * Sorry for the inconvenience, I am wondering if smooth back to top scrolling button
   script accidentally interferes the appointments next/prev button’s AJAX behavior.
   To troubleshoot, please edit the _js/scripts.js_ file of Moesia. Then remove 
   this code block:
 *     ```
       //Smooth scrolling
       jQuery(function($) {
           $('a[href*="#"]:not([href="#"],[class*="tab"] a,.wc-tabs a, .activity-content a)').click(function() { 
       		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
       			var target = $(this.hash);
       			var topbar = $('.top-bar').height();
       			target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
       			if ( this.hash != '#site-navigation' && $(window).width() > 1024 ) {
       				if (target.length) {
       				$('html,body').animate({
       				scrollTop: target.offset().top - topbar + 40
       				}, 800);
       				return false;
       				}
       			} else {
       				if (target.length) {
       				$('html,body').animate({
       				scrollTop: target.offset().top
       				}, 800);
       				return false;
       				}				
       			}
       		}
       	});
       });
       ```
   
 * Regards,
    Kharis

Viewing 1 replies (of 1 total)

The topic ‘Appointments Plugin javascript conflict with theme’ is closed to new 
replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/moesia/1.54/screenshot.png)
 * Moesia
 * [Support Threads](https://wordpress.org/support/theme/moesia/)
 * [Active Topics](https://wordpress.org/support/theme/moesia/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/moesia/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/moesia/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Kharis Sulistiyono](https://wordpress.org/support/users/kharisblank/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/appointments-plugin-javascript-conflict-with-theme/#post-9807635)
 * Status: not resolved