Note that there are some explanatory texts on larger screens.

plurals
  1. POphp button link with JQuery
    primarykey
    data
    text
    <p>I have a jquery text rotator that rotates text pulling from a database with PHP. Here's a diagram: </p> <p><img src="https://i.stack.imgur.com/yJ6wS.png" alt="enter image description here"></p> <p>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=<em>6</em> 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. </p> <p>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!) </p> <pre><code> &lt;div id="rotate"&gt; &lt;?php while ($row = mysql_fetch_assoc($result)) { $id = $row['id']; echo" &lt;font&gt; ".$row['tag']." &lt;/font&gt;"; }?&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class='grid_2'&gt;&lt;a href='events.php?id=&lt;?php echo $id;?&gt;'&gt;&lt;button id='eventinfo'&gt;event info &amp;raquo;&lt;/button&gt;&lt;/a&gt;&lt;/div&gt; </code></pre> <p>and here is the rotate code:</p> <pre><code>&lt;script type="text/javascript"&gt; (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}); }); &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload