lostprophetpunk Posted August 4, 2009 Share Posted August 4, 2009 Heya there, I have a slight problem...I have coded a simple jQuery image gallery, but the thing is...I want to add some text as well in <p> tags. to go along the side of the image. I was just wondering how I would do this. The jQuery for this is... $(document).ready(function() { var imgWrapper = $('.slideshow > img'); // only show the first image, hide the rest imgWrapper.hide().filter(':first').show(); $('ul.recentlist li a').click(function () { if (this.className.indexOf('current') == -1){ imgWrapper.hide(); imgWrapper.filter(this.hash).fadeIn(500); $('ul.recentlist li a').removeClass('current'); $(this).addClass('current'); } return false; }); }); The html for this is... <div class="slideshow" style='margin: auto; clear: both; margin-top: 90px;'> <ul class="recentlist"> <li><a class="current" href="#slide1">1</a></li> <li><a href="#slide2">2</a></li> <li><a href="#slide3">3</a></li> </ul> <img id="slide1" src="http://www.incg.nl/blog/2009/simple-slideshow-with-jquery/example/slide-1.gif" alt="Image 1 slideshow" /> <img id="slide2" src="http://www.incg.nl/blog/2009/simple-slideshow-with-jquery/example/slide-2.gif" alt="Image 2 slideshow" /> <img id="slide3" src="http://www.incg.nl/blog/2009/simple-slideshow-with-jquery/example/slide-3.gif" alt="Image 3 slideshow" /> </div> If anyone could help out that would be great, thanks in advance. Link to comment https://forums.phpfreaks.com/topic/168775-jquery-problem/ Share on other sites More sharing options...
alex3 Posted August 5, 2009 Share Posted August 5, 2009 Could you not wrap all those img tags in p tags? And then modify the jQuery code to show the p tags rather than images. So you'd have <p><img src="blah">Some text</p> Link to comment https://forums.phpfreaks.com/topic/168775-jquery-problem/#findComment-891275 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.