Add links to dynamic Jquery slider

I have a Jquery slider working fine with the attached code. The images load from the database and the first image has the required class of 'active'

What i'm trying to do now is add a link but when I try this code with the link...

</div>  <div class="holder">
<div id="slideshow">

 <?php $counter = 1; do { ?>
     <a href="<?php echo $row_homeImages['link']; ?>"><img src="upload/<?php echo $row_homeImages['imageUpload']; ?>" alt="Lilles Market1"  width="923" height="290" class="<?php if ($counter++ == 1) echo 'active'; ?>" /></a>
<?php } while ($row_homeImages = mysql_fetch_assoc($homeImages)); ?> </div>

  </div></div>

 ...the first image just shows over again. How should I be adding the link here?
</div>  <div class="holder">
<div id="slideshow"> 

 <?php $counter = 1; do { ?>
     <img src="upload/<?php echo $row_homeImages['imageUpload']; ?>" alt="Lilles Market1"  width="923" height="290" class="<?php if ($counter++ == 1) echo 'active'; ?>" />
    <?php } while ($row_homeImages = mysql_fetch_assoc($homeImages)); ?> </div>

  </div></div>

Open in new window

BrighteyesDesignAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Lukasz ChmielewskiCommented:
Why not like this:

</div>  <div class="holder">
<div id="slideshow"> 

<?php 
   $counter = 1; 
   while ($row_homeImages = mysql_fetch_assoc($homeImages)){
?>
     <img src="upload/<?php echo $row_homeImages['imageUpload']; ?>" alt="Lilles Market1"  width="923" height="290" class="<?php if ($counter++ == 1) echo 'active'; ?>" />

    <?php $counter++; }  ?> </div>

  </div></div>

Open in new window

0
Lukasz ChmielewskiCommented:
Sorry, missed the if part:

</div>  <div class="holder">
<div id="slideshow"> 

<?php 
   $counter = 1; 
   while ($row_homeImages = mysql_fetch_assoc($homeImages)){
?>
     <img src="upload/<?php echo $row_homeImages['imageUpload']; ?>" alt="Lilles Market1"  width="923" height="290" class="<?php if ($counter == 1) echo 'active'; ?>" />

    <?php $counter++; }  ?> </div>

  </div></div>

Open in new window

0
BrighteyesDesignAuthor Commented:
Thanks for that,

That works in the same way as the original code. I can't seem to incorporate a link from the image.

Your code with an image link added gives you this...

http://www.travelstareuropean.com/NEW/indextest.php

Just the first image repeats



But without the link (code below) it's fine...

http://www.travelstareuropean.com/NEW/index.php



<?php 
   $counter = 1; 
   while ($row_homeImages = mysql_fetch_assoc($homeImages)){
?>
     <img src="upload/<?php echo $row_homeImages['imageUpload']; ?>" alt="Lilles Market1"  width="923" height="290" class="<?php if ($counter == 1) echo 'active'; ?>" />

    <?php $counter++; }  ?>

Open in new window

<?php 
   $counter = 1; 
   while ($row_homeImages = mysql_fetch_assoc($homeImages)){
?>
     <a href="test.html"><img src="upload/<?php echo $row_homeImages['imageUpload']; ?>" alt="Lilles Market1"  width="923" height="290" class="<?php if ($counter == 1) echo 'active'; ?>" /></a>

    <?php $counter++; }  ?>

Open in new window

0
Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

BrighteyesDesignAuthor Commented:
So just to recap, I need all the images to display and have links
0
Lukasz ChmielewskiCommented:
The images (at least with the code) seem to load fine - look at the source. I guess there's something wrong with the links attached to images. Can you post your jQuery here ?
Wrapping the images around with <a> tags changes the way jQuery looks up for the next element.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BrighteyesDesignAuthor Commented:
It was how Jquery treats links. Rather than persevere with this code I simply used another Jquery slider that supported links.

Just really of thought of that sooner!

Cheers for your help though.
0
Lukasz ChmielewskiCommented:
Thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.