You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

Overlay target with .next() Created Mar 21, 2010

This thread is solved

Views: 2223     Replies: 2     Last reply Jun 2, 2010  
You must login first before you can use this feature

BNS23

Posts: 1

Registered:
Mar 21, 2010

Overlay target with .next()

Posted: Mar 21, 2010


//Overlay
	$(".Show_List_Entrie_Image").overlay({
		target: ".Show_List_Entrie_Image".next()
	});

Hello, today I've worked the first time with the Overlay-Tool. So please don't shot me ;)
I have a PHP Loop which generates List_X's divs and I didn't want to make a jquery code for each div, so I tried to solve it with the code above.
But Nothing is happening... can anyone tell me my error in reasoning?


<div id="List_X" class="Show_List_Entrie">
	<img class="Show_List_Entrie_Image" src="img.png" alt="" title="" />
	<div class="Show_List_Entrie_List" style="display:none;">
	BLA
	</div>
</div>

Thx. :)
P.S. I hope my english is not too bad.

dantan

Posts: 6

Registered:
May 12, 2010

» Overlay target with .next()

Posted: Jun 1, 2010

Reply to: Overlay target with .next(), from BNS23
So it is not possible to have the next div as a target?

dantan

Posts: 6

Registered:
May 12, 2010

Found a solution

Posted: Jun 2, 2010

Reply to: Overlay target with .next(), from BNS23
Maybe not the best, but it is working for now:
if ($('.clickToOpen').length){
			$('.clickToOpen').each(function(i,value) {
				var id = $(this).attr('for');
				var rel = 'ol' + id;
				$(this).attr('rel', '#'+rel);
				$(this).parent().next('.simple_overlay').attr('id',rel);
			});
		}

		var overlay = $(".clickToOpen").overlay({
			api: true,
			onBeforeLoad : function(a,i) {
			},
			onLoad : function(a,i) {
			}