BrighteyesDesign
asked on
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['imageUplo ad']; ?>" alt="Lilles Market1" width="923" height="290" class="<?php if ($counter++ == 1) echo 'active'; ?>" /></a>
<?php } while ($row_homeImages = mysql_fetch_assoc($homeIma ges)); ?> </div>
</div></div>
...the first image just shows over again. How should I be adding the link here?
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['imageUplo
<?php } while ($row_homeImages = mysql_fetch_assoc($homeIma
</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>
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>
ASKER
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
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++; } ?>
<?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++; } ?>
ASKER
So just to recap, I need all the images to display and have links
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
Just really of thought of that sooner!
Cheers for your help though.
Thanks.
Open in new window