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 6585929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:43:33+00:00 2026-05-25T16:43:33+00:00

Working currenly on news scroller – see my live example here – EXAMPLE When

  • 0

Working currenly on news scroller – see my live example here – EXAMPLE

When I press next/prev arrow I’m getting an error log Uncaught Syntax error, unrecognized expression: [object Object]

Why is the problem? Where is the error in the syntax?

jQuery Code:

        (function($) {
    /*!  Scroller
        ---------------------------------------------*/
        $.fn.Scroller = function() {

            //Set height
            $('.scroller').each(function() {
                var height = 0;
                $(this).children('div').each(function() {

                    if (height < $(this).height()) {
                        height = $(this).height();
                    }

                });
                $(this).css("height", height + "px");

            });

            $('.scroller').each(function() {

                var NextArrow = $(this).parent().find('.next');
                var PrevArrow = $(this).parent().find('.prev');


                // Set a timeout
                var timeOut = setTimeout(nextNotice, 5000);

                // pause on hover
                $(this).hover(

                function() {
                    clearTimeout(timeOut);
                }, function() {
                    timeOut = setTimeout(nextNotice, 5000);
                });

                // Next notice function called on timeout or click
                //set a flag that use to be an oberver to listen when the fadeIn done
                var flag = true;

                function nextNotice(event) {

                    var CurrentScrollerDiv = $(this).parent().find('.scroller');

                    if (!flag) {
                        return false;
                    }
                    clearTimeout(timeOut);

                    flag = false;
                    timeOut = setTimeout(nextNotice, 5000);

                    if ($(CurrentScrollerDiv + ' div:visible').is(CurrentScrollerDiv + '  div:last-child')) {
                        $(CurrentScrollerDiv + ' div:visible').fadeOut(300);
                        $(CurrentScrollerDiv + ' div:first-child').fadeIn("slow", function() {
                            flag = true;
                        });
                    } else {
                        $(CurrentScrollerDiv + ' div:visible').fadeOut(300).next('div').fadeIn("slow", function() {
                            flag = true;
                        });
                    }
                    return false;
                }

                $(NextArrow).click(nextNotice);
                $(PrevArrow).click(function(event) {

                    var CurrentScrollerDiv = $(this).parent().find('.scroller');

                    if (flag) {
                        return false;
                    }
                    clearTimeout(timeOut);

                    flag = false;
                    timeOut = setTimeout(nextNotice, 5000);

                    if ($(CurrentScrollerDiv + ' div:visible').is(CurrentScrollerDiv + ' div:first-child')) {
                        $(CurrentScrollerDiv + ' div:visible').fadeOut(300);
                        $(CurrentScrollerDiv + ' div:last-child').fadeIn("slow", function() {
                            flag = true;
                        });
                    }
                    else {
                        $(CurrentScrollerDiv + ' div:visible').fadeOut(300).prev('div').fadeIn("slow", function() {
                            flag = true;
                        });
                    }
                    return false;

                });

            });

        };

    })(jQuery);


    $(document).ready(function() {
        //Blog
        $('.itBlog > div:first-child').show();

        //Scroller
        $('.scroller').Scroller();

    });
  • 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-05-25T16:43:34+00:00Added an answer on May 25, 2026 at 4:43 pm

    To build selectors from existing objects, use the second parameter of $:

    $('div:visible', CurrentScrollerDiv)
    

    Or the find function:

    CurrentScrollerDiv.find('div:visible');
    

    CurrentScrollerDiv is not a string so it cannot be concatenated with a string to generate a string-based selector argument.


    jQuery( selector, [ context ]  )
        jQuery( selector, [context] )    <-- you want this one, and
        jQuery( element )                    `selector` is a string
        jQuery( elementArray )
        jQuery( jQuery object )
        jQuery()
    jQuery( html, [ ownerDocument ]  )
        jQuery( html, [ownerDocument] )
        jQuery( html,props )
    jQuery( callback  )
        jQuery( callback )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The cms I'm currently working with only supports live editing of data (news, events,
I'm currently working on my news system on my webpage, and I've come to
I am working a project currently in which the user can add multiple news
Has anyone found a workaround yet for getting custom dictionary support working for the
I'm using GWT (currenly working with google's eclipse plugin), and I'm trying to throw
I'm currently working on a blog for a college news organization. Each post, though,
Alright, see if I can pick your brains from you all. I'm currently working
I currently working on an issue tracker for my company to help them keep
Am currently working on an application that requires users to submit posts and comments
Currently working in the deployment of an OFBiz based ERP, we've come to the

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.