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

  • Home
  • SEARCH
  • 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 7049093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:58:15+00:00 2026-05-28T02:58:15+00:00

A relatively (I hope) simple jQuery question: I have a menu: <ul id=menu style=list-style:none>

  • 0

A relatively (I hope) simple jQuery question:

I have a menu:

<ul id="menu" style="list-style:none">
    <li><a href="#asics">ASICS</a></li>
    <li>/</li>
    <li><a href="#plants">PLANTS PLUS</a></li>
    <li>/</li>
    <li><a href="#tooheys">TOOHEYS</a></li>
    <li>/</li>
    <li><a href="#olympics">OLYMPICS</a></li>
    <li>/</li>
    <li><a href="#panadol">PANADOL</a></li>
    <li>/</li>
    <li><a href="#kia">KIA CADENZA</a></li>
</ul>

The menu is controlling a slider (code not necessary, just standard cycle divs. Here is the code, taken from the jQuery Cycle Plugin Pager Tutorial:

var slider = new Swipe(document.getElementById('slider'));
$('#adSlideshow').cycle({ 
    fx:     'fade', 
    speed:  'fast', 
    timeout: 0,  
    pager:  '#menu',
    pagerAnchorBuilder: function(idx, slide) { 
        // return selector string for existing anchor 
        return '#menu li:eq(' + idx + ') a'; 
    }
});

As you can see, in my menu every second link (the ones with the tags) is relevant for the pager; every <li>/</li> item is just a spacer between each link item. How can I edit the pager code so that it only uses the correct <li> items?

Here’s a jsFiddle of it to better illustrate what I mean: http://jsfiddle.net/y4Qfw/12/ <– As you can see, the links are calling every 2nd div. At the moment I’m just putting dummy divs in every second position so that the code works fine, but I’d rather find a less bulky solution. Thoughts?

  • 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-28T02:58:16+00:00Added an answer on May 28, 2026 at 2:58 am

    Dont use <li>/</li> for spacing .. use another element or even better remove them and use the following CSS rule :

    #menu li {
        margin-bottom: 30px;
    }
    

    Example : http://jsfiddle.net/y4Qfw/13/

    Use the elements for what they are meant for

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

Sidebar

Related Questions

I'm relatively new to jquery, so I have what I hope will be a
Simple question I hope. If I have a set of data like this: Classification
I have what should be a relatively simple question that I can't seem to
I hope this is a relatively easy problem although I have spent hours websearching
I'm relatively new to web application programming so I hope this question isn't too
I'm relatively new to CSS, and have used it to change the style and
simple problem ( I hope) I have a div: with css: .break{position:relative;height:1px;background-color:#555555;margin:5px 10px 10px
Relatively new to rails and trying to model a very simple family tree with
Given a relatively simple CSS: div { width: 150px; } <div> 12333-2333-233-23339392-332332323 </div> How
My program generates relatively simple PDF documents on request, but I'm having trouble with

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.