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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:59:45+00:00 2026-05-25T09:59:45+00:00

I have a Jquery Cycle slideshow that has a click function to animate a

  • 0

I have a Jquery Cycle slideshow that has a click function to animate a pager navigation. this works if the slideshow is manual. I now want the slideshow to run automatically and the pager navigation to animate with the change of the slideshow image. This is the code that works with a manual click but now that i have set the slideshow to run automatically this code wont get actioned. What do i need to change to get the event to occur

<script type="text/javascript">
        //<![CDATA]
        $(function(){
           //  nav animation2  
        $('#nav_move').css({
        width: 16,
        height: 16
        });

        $('#navi a').click(function() {
        var offset = $(this).offset();
        var offsetbody= $('#nav').offset();
        //find the offset of the wrapping div    
        $('#nav_move').animate({
            width: $(this).width()+7,
            height: 16,
            left: (offset.left-offsetbody.left-1.2)
        });
        return false;
        });        
    });
        //]]>
        </script>

This is the code for the page

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    <meta name="author" content="Michael Horsfall" />

    <title>Client Slideshow</title>

    <script src="modules/mod_clients_slideshow/js/jquery-1.6.2.min.js" type="text/javascript"></script>
    <script src="modules/mod_clients_slideshow/js/jquery.cycle.all.js" type="text/javascript"></script>
    <script src="modules/mod_clients_slideshow/js/preloadCssImages.jQuery_v5.js" type="text/javascript"></script>

    <script type="text/javascript">
    $(document).ready(function(){
    $.preloadCssImages();
    });
    </script>


    <script type="text/javascript">
        $(document).ready(function(){
        $('#myslides').cycle({
            fx: '<?php echo $effectFx; ?>',
            speed: <?php echo $speed; ?>,
            timeout: 1000,
            nowrap: 0,
            fit: 1,
            pause: 2,
            pager: '#navi'
        });
        $('#nav .next a').click(function(){
        var nextClick = $('#navi a.activeSlide').next('a');
        $(nextClick).click();
        return false;
        })
        // back arrow
        $('#nav .prev a').click(function(){
        var prevClick = $('#navi a.activeSlide').prev('a');
        $(prevClick).click();
        return false;
        })
        });
    </script>
    <script type="text/javascript">
    //<![CDATA]
    $(function(){
       //  nav animation2  
    $('#nav_move').css({
    width: 16,
    height: 16
    });

    $('#navi a').click(function() {
    var offset = $(this).offset();
    var offsetbody= $('#nav').offset();
    //find the offset of the wrapping div    
    $('#nav_move').animate({
        width: $(this).width()+7,
        height: 16,
        left: (offset.left-offsetbody.left-1.2)
    });
    return false;
    });        
});
    //]]>
    </script>

    <link rel="stylesheet" href="modules/mod_clients_slideshow/css/style.css" type="text/css" media="screen" />
</head>

<body>
<div id="container">
<h1>
<?php

try {       
    // Styling for images   
    echo "<div id=\"myslides\">";

    $files = new DirectoryIterator($imageFolder);
    $i=0;
    $files_array = array();
    foreach ($files as $fileinfo){
        if ($fileinfo->isFile()){
        $files_array[$i++]=$fileinfo->getFileName();
        }
    }
    asort($files_array);
    foreach ( $files_array as $file ) {         
            $path = $imageFolder . "/" . $file;
            $fileBaseName=basename($path,".jpg");
            $trimmed=substr($fileBaseName,2);
            echo "<img src=\"" . $path . "\" alt=\"" . $trimmed . "\" />";  
        }
    echo "</div>";
}   
catch(Exception $e) {
    echo 'No images found for this slideshow.<br />';   
}
?>
</h1>
</div>
<div id="nav" class="nav">

<span id="nav_move"></span>
<div id="navi" class="navi">
</div>

</div>


</body>
</html>
  • 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-25T09:59:46+00:00Added an answer on May 25, 2026 at 9:59 am

    The cycle plugin has options allowing you to set callbacks – onPagerEvent and onPrevNextEvent. I would use these callbacks to do the additional animations.

    cycle options: http://jquery.malsup.com/cycle/options.html

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

Sidebar

Related Questions

I have some jQuery code. I have called an Ajax function file, file.php, that
I have this jQuery code that queries an API on a keyup event (via
I am using Jquery Cycle Plugin and it has a side panel that highlights
I currently have a site that uses the JQuery cycle plugin. The site uses
I am working on a website that has incorporated the jquery cycle plugin. It
I am using the cycle jquery plugin. I have a few images that fade
I'm currently using this jQuery Cycle Plugin: http://jquery.malsup.com/cycle/ And I have the following code:
I have a jQuery slideshow, I'm using the cycle plugin. I'm decent with jQuery,
Say I have jquery code like this: html += '<div class=index>' + item.index +
I have some jQuery/JavaScript code that I want to run only when there is

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.