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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:53:12+00:00 2026-05-26T07:53:12+00:00

I have the following html: <a href="#" id="#1" class="pagerlink" >link</a> <a href="#" id="#3" class="pagerlink"

  • 0

I have the following html:

<a href="#" id="#1" class="pagerlink" >link</a>
<a href="#" id="#3" class="pagerlink" >link</a>
<a href="#" id="#2" class="pagerlink" >link</a>
/*etc.... */

and the following jQuery script:

$(document).ready(function() {
    
    var $container = $('.gallery_r').cycle({ 
        fx:     'scrollHorz', 
        speed:   500, 
        timeout: 0 
    }); 
    
    $('a.pagerlink').click(function() { 
        var id = $(this).attr('id');
        $container.cycle(id); 
        return false; 
    }); 
    
});

the ‘pagerlink’ links control are to jQuery Cycle slideshow. If I swap this line:

$container.cycle(id); 

for this

$container.cycle(7); 

It works. (obviously only navigating to slide number 7). So, my question is how can I pick up the ID of the link being clicked and pass it into that line?

  • 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-26T07:53:13+00:00Added an answer on May 26, 2026 at 7:53 am

    Your IDs are #1, and cycle just wants a number passed to it. You need to remove the # before calling cycle.

    $('a.pagerlink').click(function() { 
        var id = $(this).attr('id');
        $container.cycle(id.replace('#', '')); 
        return false; 
    });
    

    Also, IDs shouldn’t contain the # character, it’s invalid (numeric IDs are also invalid). I suggest changing the ID to something like pager_1.

    <a href="#" id="pager_1" class="pagerlink" >link</a>
    
    $('a.pagerlink').click(function() { 
        var id = $(this).attr('id');
        $container.cycle(id.replace('pager_', '')); 
        return false; 
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a HTML with the following format <article class="cik" id="100"> <a class="ci" href="/abc/1001/STUFF">
I'm having problems using ajax with jQuery... I have the following jscript: $(document).ready(function() {
I have the following code that works: <script type=text/javascript> $(document).ready(function() { // Initialise the
I have following jQuery code $('a.editpo, a.resetpass').click(function(event){ event.preventDefault(); var urlToCall = $(this).attr('href'); var hyperlinkid
I have the following html <div id=menu> <ul class=horizMenu> <li id=active><a href=# id=current>About</a></li> <li><a
I have the following file: <html> <head> <title></title> <link rel=css type=text/css href=/empty.css title=css />
I have the following code: <html> <head> <script type=text/javascript language=javascript src=jquery/jquery-1.5.1.js></script> <script type=text/javascript language=javascript
My problem is a little bit complex. I have the following code: $(document).ready(function() {
I have the following javascript variable: <script> var theme=Videocameras; </script> And the following html
I am creating a page. I have the following HTML: <ul id=nav> <li><a href=#section1>Link</a></li>

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.