Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8864647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:17:42+00:00 2026-06-14T16:17:42+00:00

I have the following script, but when i move to a page that don’t

  • 0

I have the following script, but when i move to a page that don’t have #slider breaks the code that is below it, what i tried to do is check if the #slider is on the page otherwise just return but it didn’t work i’m getting this error.
Uncaught TypeError: Object [object Object] has no method ‘slitslider’

pointing to this section slitslider = $( '#slider' ).slitslider( {

(function ($) {
  if ($('#slider')) {
    var Page = (function () {
      var $navArrows = $('#nav-arrows'),
        $nav = $('#nav-dots > span'),
        slitslider = $('#slider').slitslider({
          autoplay: true,
          onBeforeChange: function (slide, pos) {

            /**
             * THIS SECTION MANAGES THE TRIANGLE COLORS EVERY TIME THE SLIDER BACKGROUND CHANGES SO DOES THE TRIANGLE.
             */
            //get the colors of each slide
            //and set it that color to the bottom-triangle.
            var newpos = pos;
            ++newpos;
            var triangleColor = $('.bg-' + newpos + ' .sl-slide-inner').css('backgroundColor');
            $('.expertise-triangle').css('border-color', triangleColor + ' transparent transparent transparent');
            /**
             * THIS SECTION HANDLES THE DOT NAVIGATIONS ON TOP OF THE TRIANGLES.
             */

            $nav.removeClass('nav-dot-current');
            $nav.eq(pos).addClass('nav-dot-current');
          }
        }),
        init = function () {
          initEvents();
        },
        initEvents = function () {
          // add navigation events
          $navArrows.children(':last').on('click', function () {
            slitslider.next();
            return false;
          });
          $navArrows.children(':first').on('click', function () {
            slitslider.previous();
            return false;
          });
          $nav.each(function (i) {
            $(this).on('click', function (event) {
              var $dot = $(this);
              if (!slitslider.isActive()) {
                $nav.removeClass('nav-dot-current');
                $dot.addClass('nav-dot-current');
              }
              slitslider.jump(i + 1);
              return false;
            });
          });
        };
      return {
        init: init
      };
    })();
    Page.init();
  } else {
    return;
  }
})(jQuery);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T16:17:43+00:00Added an answer on June 14, 2026 at 4:17 pm

    Actually you might have an dom-element called #slider but don’t have included the according slitslider plugin on that page. Also you need to check the length of the array, because $() always returns an array and an empty array (if there is no match) is also truthy.
    That’s why the error Object [object Object] (your slider element) has no method 'slitslider' (missing slitslider function.)

    You need to check if($('#slider').length && $().slitslider ) to prevent that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following PHP script: <?php $fortune = `fortune`; echo $fortune; ?> but
I have written a Perl script for the following bioinformatics question, but unfortunately there
I have following script that executes all the .reg files in the current directory.
I have the following script below where I try to mimic a file upload
I have the following script which appears multiple times on my page. I have
I have tried the following on the command line and they work, but when
I have a PS script that kicks off every 5 minutes to check for
I was wondering if the following is possible. I have a BASH script that
I have an existing image upload script (below) which works fine but I would
I have the following code: <html> <head> <script src=http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js></script> <script> $(document).ready(function() { // hides

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.