searls03 Posted December 18, 2011 Share Posted December 18, 2011 Ok this is a jquery/php question. What I have is a code that shows images from a database. <div class="imagewrapper"> <form action="upload.php" method="post"> <?php $sql = mysql_query("SELECT id, link FROM products WHERE id>='$basenumber' limit 8"); while($row = mysql_fetch_array($sql)){ $imageid = $row['id']; $image2 = $row['link']; ?> <div class="imageholder"><div id="apDiv<?php echo $imageid;?>"><img src="<?php echo $image2;?> " width="300" /></div> </div> <?php } ?> What I want is to use a jquery code similar to this site: http://papermashup.com/jquery-show-hide-plugin/. I need the code to be inside of loop like the image displaying is. I want entries for photos to pop up if I want to upload a new image in the place of the one that was there, but I have to click the link to show the form though. do you think you can help? Quote Link to comment Share on other sites More sharing options...
scootstah Posted December 19, 2011 Share Posted December 19, 2011 I don't quite understand your question. So you want to click an image and have a form pop up? Quote Link to comment Share on other sites More sharing options...
searls03 Posted December 21, 2011 Author Share Posted December 21, 2011 no, not quite. what I would like is so that the images will show, but there is a link underneath of them that will say "change", and then a form will appear and the picture will disappear and then I can upload a new image, the only problem is that these are in loops, so it will be the same code repeating over and over for each picture, but I want to make sure that only the picture I want to change has a form appear over it.. does this make more sense? Quote Link to comment Share on other sites More sharing options...
scootstah Posted December 21, 2011 Share Posted December 21, 2011 How's this work for you? http://jsfiddle.net/PwGZ3/ Quote Link to comment Share on other sites More sharing options...
searls03 Posted December 21, 2011 Author Share Posted December 21, 2011 kinda sorta, I need them in a php loop and only one changes at a time, not all four like it showed. Quote Link to comment Share on other sites More sharing options...
scootstah Posted December 22, 2011 Share Posted December 22, 2011 Only one does change at a time. You can put this in a loop. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.