suggestion.....post a link ( jsbin works great) or slimmed down version of the problem . It's really hard to read unformatted code with multi line links of long href's, style etc, trying to figure out which is a green box.


far more likely to get feedback that way

theprodigy wrote:
I'm creating a photo gallery admin section. I'm allowing the user to
decide which single image they would like to be the gallery image (the
image that displays on the list of galleries page). I am using a green
box to show which image is currently set as the gallery image, and a
red box to show which one's are not selected.

The green box is set as just the image, whereas the red box is a link
to select that image.

The code I currently have seems to turn all the images into red boxes,
but does not turn the currently clicked item green.

Here is what I have:
[code]
$(".main_image").live('click',function(){
	var href = ""
	$.get(href);
	var $rows = $('#main_table tr');

	$rows.each(function(){
		var $id = $(this).attr('id');
		$id = $id.split("_");
		$id = $id[1];

		$(this).find('.gallery_image').html('<a class="main_image" href=""><img alt="" title="Main"
style="border: 0pt none;" src="" /></a>');
	});
	$(this).parent().html=("<img src='' alt='' /
  
");
    

	return false;
});
[/code]

The table that the html is in is setup as:
[code]
<table  width="95%" id="main_table" cellpadding="0" cellspacing="0"
border="0">
<tr>
<th colspan="2" align="left">Move</th>
<th></th>
<th align="left">Name and Description</th>
<th></th>
<th colspan="2" align="left">Options</th>
<th></th>
<th align="left">Show/Hide</th>
<th></th>
<th align="left">Gallery&nbsp;Image</th>
</tr>
<tr id="photo_1" class="photo">
<td valign="top">
	<a href="" class="moz-txt-link-rfc2396E" href="http://www.hypertextwebdesign.com/admin/galleries/p_moveup/1.php">"http://www.hypertextwebdesign.com/admin/galleries/p_moveup/
1.php" class="moveup" style="display:none;"><img src='' style='border:0;margin:0' title='Move Up' alt='' /></a>
</td>
<td valign="top">
	<a href="" class="moz-txt-link-rfc2396E" href="http://www.hypertextwebdesign.com/admin/galleries/p_movedown/1.php">"http://www.hypertextwebdesign.com/admin/galleries/p_movedown/
1.php" class="movedown"><img src=''
style='border:0;margin:0' title='Move Down' alt='' /></a>
</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td valign="top"><a href="" class="moz-txt-link-rfc2396E" href="http://www.hypertextwebdesign.com/admin/galleries/p_view/1.php">"http://www.hypertextwebdesign.com/admin/
galleries/p_view/1.php" class="image_popup">test photo</a><br />this
is a test photo entry. No photo actually exists for this record.</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td valign="top"><a href="" class="moz-txt-link-rfc2396E" href="http://www.hypertextwebdesign.com/admin/galleries/p_edit/1.php">"http://www.hypertextwebdesign.com/admin/
galleries/p_edit/1.php"><img src=''
style='border:0;margin:0' title='Edit Photo Info' alt='' /></a></td>
<td valign="top"><a href="" class="moz-txt-link-rfc2396E" href="http://www.hypertextwebdesign.com/admin/galleries/p_delete/1.php">"http://www.hypertextwebdesign.com/admin/
galleries/p_delete/1.php" class="delete"><img src='' style='border:0;margin:0' title='Delete Photo' alt='' /></
a></td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td valign="top" style="text-align:center;">
	<a href="" class="moz-txt-link-rfc2396E" href="http://www.hypertextwebdesign.com/admin/galleries/p_deactivate/1.php">"http://www.hypertextwebdesign.com/admin/galleries/
p_deactivate/1.php" class="active"><img src='' style='border:0' title='Active' alt='' /></a>
</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td valign="top" style="text-align:center;" class="gallery_image">
	<img src="" class="moz-txt-link-rfc2396E" href="http://www.hypertextwebdesign.com/admin/images/greenbox.png">"http://www.hypertextwebdesign.com/admin/images/
greenbox.png" />
</td>
</tr>
<tr>
<td colspan="11"><hr /></td>
</tr>
<tr id="photo_2" class="photo">
<td valign="top">
	<a href="" class="moz-txt-link-rfc2396E" href="http://www.hypertextwebdesign.com/admin/galleries/p_moveup/2.php">"http://www.hypertextwebdesign.com/admin/galleries/p_moveup/
2.php" class="moveup"><img src='' style='border:
0;margin:0' title='Move Up' alt='' /></a>
</td>
<td valign="top">
	<a href="" class="moz-txt-link-rfc2396E" href="http://www.hypertextwebdesign.com/admin/galleries/p_movedown/2.php">"http://www.hypertextwebdesign.com/admin/galleries/p_movedown/
2.php" class="movedown" style="display:none"><img src='' style='border:0;margin:0' title='Move Down' alt='' /></a>
</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td valign="top"><a href="" class="moz-txt-link-rfc2396E" href="http://www.hypertextwebdesign.com/admin/galleries/p_view/2.php">"http://www.hypertextwebdesign.com/admin/
galleries/p_view/2.php" class="image_popup">test photo</a><br />this
is a test photo entry. No photo actually exists for this record.</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td valign="top"><a href="" class="moz-txt-link-rfc2396E" href="http://www.hypertextwebdesign.com/admin/galleries/p_edit/2.php">"http://www.hypertextwebdesign.com/admin/
galleries/p_edit/2.php"><img src=''
style='border:0;margin:0' title='Edit Photo Info' alt='' /></a></td>
<td valign="top"><a href="" class="moz-txt-link-rfc2396E" href="http://www.hypertextwebdesign.com/admin/galleries/p_delete/2.php">"http://www.hypertextwebdesign.com/admin/
galleries/p_delete/2.php" class="delete"><img src='' style='border:0;margin:0' title='Delete Photo' alt='' /></
a></td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td valign="top" style="text-align:center;">
	<a href="" class="moz-txt-link-rfc2396E" href="http://www.hypertextwebdesign.com/admin/galleries/p_deactivate/2.php">"http://www.hypertextwebdesign.com/admin/galleries/
p_deactivate/2.php" class="active"><img src='' style='border:0' title='Active' alt='' /></a>
</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td valign="top" style="text-align:center;" class="gallery_image">
	<a href="" class="moz-txt-link-rfc2396E" href="http://www.hypertextwebdesign.com/admin/galleries/p_makemain/2.php">"http://www.hypertextwebdesign.com/admin/galleries/p_makemain/
2.php" class="main_image"><img src=''
style='border:0' title='Main' alt='' /></a>
</td>
</tr>
<tr>
<td colspan="11"><hr /></td>
</tr>
</table>
[/code]

Please help. I appreciate any and all help

  

Reply via email to