0

Alright, I am using the "FancyBox" script to load a larger photo, plus information about the photo into a window, ontop of the window.... which works great. However I need to pass the id (or other unique value) to the javascript so it can pass it on and get the right image and info.

My photo gallery thumbnails are loaded via ajax as well using the $.(#alpha).live('click') method, which should allow me to use jquery on the loaded info (as it has let me in the past).

After I load my gallery it looks similar to:

<div id="photo_gal">
  <div class="picture left" style="height:160px;"><a id="e1" class="the_elevators" href="#1"><img src="thumb.php?im=photographs/c/carrot2.jpg" alt="Carrot River, Saskatchewan" /><br /><div align="center">Carrot River<br />Saskatchewan</div></a></div>
  <div class="picture left" style="height:160px;"><a id="e2" class="the_elevators" href="#2"><img src="thumb.php?im=photographs/c/Carrot_River_01.jpg" alt="Carrot River, Saskatchewan" /><br /><div align="center">Carrot River<br />Saskatchewan</div></a></div>
  <div class="picture left" style="height:160px;"><a id="e3" class="the_elevators" href="#3"><img src="thumb.php?im=photographs/c/cudworth1.jpg" alt="Cudworth, Saskatchewan" /><br /><div align="center">Cudworth<br />Saskatchewan</div></a></div>
  <div class="picture left" style="height:160px;"><a id="e4" class="the_elevators" href="#4"><img src="thumb.php?im=photographs/c/cudworth2.jpg" alt="Cudworth, Saskatchewan" /><br /><div align="center">Cudworth<br />Saskatchewan</div></a></div>
</div>

and the action code is:

$("#photo_gal").fancybox({
		'type': 'custom',
		'see': ??????????
	});

where the ???? is where I need to get the value too. Anyone know how to do this?

2
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by pritaeas
0

Sorry, my bad... I made a 'custom' function which is a little cleaner than their ajax method.

case 'custom':
		$.fancybox.showActivity();
		$.get('see.php', {
			"id": selectedOpts.see
		}, function(code) {
			tmp.html(code);
			fancybox_process_inline();
		});
	break;

Basically it does the same thing as the ajax, just a little less code and headache. The "see" variable is passed to the id, but that still doesn't help me get what I need to into that "see" variable.

Edited by dnirvine: n/a

0

You can use $(this) in the click to determine your position. I don't think this is possible in the initialization, because you have no active element at that point.

0

$(this) gives me the #photo_gal area... but I need to identify the individual link that is clicked on in order to show the right photo.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.