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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:47:42+00:00 2026-06-11T15:47:42+00:00

I have a carousel on my site, and if there are no elements my

  • 0

I have a carousel on my site, and if there are no elements my jquery seems to crash.

My HTML output without elements is…

<section class="gallery-viewport-twobedroomapartment viewer">
     <ul>
     </ul>
     <a id="simplePrevious"><img alt="Left Arrow" src="_includes/images/larr.png"></a>
     <a id="simpleNext"><img alt="Right Arrow" src="_includes/images/rarr.png"></a>
</section>

And my jQuery is…

$('.gallery-viewport-twobedroomapartment').carousel('#simplePrevious', '#simpleNext');

Is it possible to say if UL contains LI then run the function?

  • 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-11T15:47:43+00:00Added an answer on June 11, 2026 at 3:47 pm
    if($('.gallery-viewport-twobedroomapartment ul > li').length > 0) {
       $('.gallery-viewport-twobedroomapartment').carousel('#simplePrevious', '#simpleNext');
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Apparently, the demo page on the http://twitter.github.com/bootstrap/javascript.html#carousel seems to have carousel stop rotating after
Ok, so I have a carousel that animates left and right. There is the
I have implemented the carousel on my webpage as follows <div class=container-fluid> <div id=myCarousel
Anyone have any idea why my jQuery carousel is working fine at the bottom
I have the following problem: I am creating a simple plugin jquery carousel, to
I have played around and implemented JQuery cycle to create a carousel with images,
I have built a carousel using the jQuery cycle plugin. I have 4 links
I have a jQuery script that creates a carousel to rotate images left and
I'm using the jquery carousel and I have the image auto rotating here (
I'm currently working on a webproject. I have to use a carousel Jquery, found

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.