Sorry for all the dumb jquery questions I'm still learning and find this to be a GREAT resource!
How can I show a <li>
on click of a class here is my html
<li><a href="#" rel="sample.gif">sample.gif</a> <a href="#" class="edit_project_file"> <img src="images/edit.gif"/></a></li>
<li class="edit_project_image" style="display:none;"><input name="upload_project_images[]" type="file" /></li>');
I am trying this (and many other combination) for my jquery:
$('.edit_project_file').click(function() {
$(".edit_project_file").next("li.edit_project_image").show();
return false;
I originally thought i would need to use this but if I understand "this" correctly it gets the current element so then i thought i needed to get the next element after the current li
.
As always, Any help would be great!
Edit: here the php code actually being used,
$image_project_images_q = mysql_query("SELECT i_project_id,i_name,i_type FROM `project_images` WHERE `i_project_id` = '$project_data[p_id]' AND i_type = '2'");
while($image_project_image_data = mysql_fetch_array($image_project_images_q)){
echo ('<li><a href="#" rel="'.$upload_project_images_path.$image_project_image_data['i_name'].'">'. $image_project_image_data['i_name'].'</a> <a href="#" class="edit_project_file"> <img src="images/edit.gif"/></a></li>');
echo('<li class="edit_project_image"><input name="upload_project_images[]" type="file" /></li>');
}
Final Edit:
Because the code is being generated though a php while loop the jquery needed to be
$('.edit_project_file').live('click',function() {
$(this).parent().next().show();
return false;
});