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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:51:23+00:00 2026-06-07T14:51:23+00:00

I have a jquery text rotator that rotates text pulling from a database with

  • 0

I have a jquery text rotator that rotates text pulling from a database with PHP.
Here’s a diagram:

enter image description here

The text then has a more info button to the side that will go to the corresponding page to the event ( So if one of the rotations is “Example Event” then the more info button will go to event.php?id=6 if the row containing “Example Event”‘s id is 6. Unfortunately, the moreinfo.php buttons link always goes to the first rotation corresponding page ( so if the first rotation is “Example Event” and “Example Event” has the id 6, then the more info button will always stay linked to the page where id=6 even when its a different rotation like “A Better Event” which has an id=8.

Thanks for any help ( I know this my description is pretty confusing). Also, if you can tell what the problem is, can you explain your solution a little (I’m learning PHP and find looking at solutions to problems I have helps me learn a lot!)

                       <div id="rotate">
                        <?php
                          while ($row = mysql_fetch_assoc($result)) {
                            $id = $row['id'];
                          echo"
                            <font>
                                ".$row['tag']."
                            </font>";
                        }?>
                        </div>
                        </div>
                    <div class='grid_2'><a href='events.php?id=<?php echo $id;?>'><button id='eventinfo'>event info &raquo;</button></a></div>

and here is the rotate code:

<script type="text/javascript">
(function($){
$.fn.extend({ 
    //plugin name - rotaterator
    rotaterator: function(options) {

        var defaults = {
            fadeSpeed: 600,
            pauseSpeed: 100,
            child:null
        };

        var options = $.extend(defaults, options);

        return this.each(function() {
              var o =options;
              var obj = $(this);                
              var items = $(obj.children(), obj);
              items.each(function() {$(this).hide();})
              if(!o.child){var next = $(obj).children(':first');
              }else{var next = o.child;
              }
              $(next).fadeIn(o.fadeSpeed, function() {
                    $(next).delay(o.pauseSpeed).fadeOut(o.fadeSpeed, function() {
                        var next = $(this).next();
                        if (next.length == 0){
                                next = $(obj).children(':first');
                        }
                        $(obj).rotaterator({child : next, fadeSpeed : o.fadeSpeed, pauseSpeed : o.pauseSpeed});
                    })
                });
        });
    }
});
})(jQuery);

$(document).ready(function() {
    $('#rotate').rotaterator({fadeSpeed:1200, pauseSpeed:6000});
}); 

    </script>
  • 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-07T14:51:25+00:00Added an answer on June 7, 2026 at 2:51 pm

    When you make your rotate div, you can add hidden fields to each loop to save the id of each iteration.

    <div id="rotate">
    <?php
    $index = 0;
    while ($row = mysql_fetch_assoc($result)) {
      $id = $row['id'];
      echo "<font>".$row['tag']."</font>";
      echo "<input type='hidden' id='rotate_".$index."' value='$id' />";
      $index++;
    }?>
    </div>
    

    Then you can maintain an index in javascript to correspond with the index I made above, and when you rotate the text, do

    var newLinkID = $('#rotate_' + index).val();
    $('.grid_2 a').attr('href', 'events.php?id=' + newLinkID);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some jquery that inputs text into a database and then clears the
i have a jquery that brinds text from a page through ajax and displays
I have this following jquery text fly-in animation.Here is my code before I explain
I have implemented the jquery scroll text in my php web site. See my
I have a jQuery jPicker colorpicker that is bound to an input text field
I have autocomplete text box, that is JQuery based. when i record the macro,
I have found various examples of using jquery to wrap selected text from a
I have used jQuery's jqrte text editor, but it has many drawbacks. Could anyone
I have a jQuery text box autocomplete script which uses a PHP script to
I have some problems with this code? Here is my code that creates text

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.