<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title>DevKick Forums - Galleria+jCarousel+ajax issues</title>
		<link>http://devkick.com/talk/topic/12/galleriajcarouselajax-issues/</link>
		<description>The most recent posts in Galleria+jCarousel+ajax issues.</description>
		<lastBuildDate>Thu, 15 May 2008 04:41:25 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title>Re: Galleria+jCarousel+ajax issues</title>
			<link>http://devkick.com/talk/post/26/#p26</link>
			<description>Okay, I got the images to expand properly, by doing this:
[code]
$(&#039;ul.gallery_show&#039;).galleria({
	history   : true, // activates the history object for bookmarking, back-button etc.
	clickNext : true, // helper for making the image clickable
	insert    : &#039;#main_image&#039;, // the containing selector for our main image
	onImage   : function(image, caption, thumb) {
		onImageGalleria(image, caption, thumb);
	},
	onThumb   : function(thumb) {
		onThumbGalleria(thumb);
	}
});
[/code]
where onImageGalleria and onThumbGalleria are:
[code]
function onImageGalleria(image, caption, thumb){ // let&#039;s add some image effects for demonstration purposes
				
	// fade in the image &amp; caption
	image.css(&#039;display&#039;,&#039;none&#039;).fadeIn(200);
	caption.css(&#039;display&#039;,&#039;none&#039;).fadeIn(200);
				
	// fetch the thumbnail container
	var _li = thumb.parents(&#039;li&#039;);
		
	// fade out inactive thumbnail
	_li.siblings().children(&#039;img.selected&#039;).fadeTo(100,0.6);
		
	// fade in active thumbnail
	thumb.fadeTo(&#039;fast&#039;,1).addClass(&#039;selected&#039;);
				
	// add a title for the clickable image
	image.attr(&#039;title&#039;,&#039;Next panel &gt;&gt;&#039;);
				
        $(&#039;#main_image&#039;).trigger(&#039;img_change&#039;);
};
	
function onThumbGalleria(thumb){ // thumbnail effects goes here
				
	// fetch the thumbnail container
	var _li = thumb.parents(&#039;li&#039;);
	// if thumbnail is active, fade all the way.
        var _fadeTo = _li.is(&#039;.active&#039;) ? &#039;1&#039; : &#039;0.6&#039;;
				
	// fade in the thumbnail when finished loading
	thumb.css({display:&#039;none&#039;,opacity:_fadeTo}).fadeIn(500);
				
	// hover effects
	thumb.hover(
		function() { thumb.fadeTo(&#039;fast&#039;,1); },
		function() { _li.not(&#039;.active&#039;).children(&#039;img&#039;).fadeTo(&#039;fast&#039;,0.6); } // don&#039;t fade out if the parent is active
		)
};
[/code]

Yes, the two functions are from Alex Wilson&#039;s gallery code, credit where credit is due. I&#039;m quite inexperienced with javascript, but not with programming in general, so I&#039;ve been muddling my way through as best as I can.

However, it now reprocesses all the images, and adds :&lt;index&gt; to each image&#039;s title attribute everytime it gets called. As well, it shows the image about 4-5 times down the page when its clicked. Any advice?</description>
			<author>dummy@example.com (Zeroth)</author>
			<pubDate>Thu, 15 May 2008 04:41:25 +0000</pubDate>
			<guid>http://devkick.com/talk/post/26/#p26</guid>
		</item>
		<item>
			<title>Re: Galleria+jCarousel+ajax issues</title>
			<link>http://devkick.com/talk/post/22/#p22</link>
			<description>Okay, how do I run the galleria code on each image load? I looked through the source code for galleria, and the closest I found was to use
$.historyInit() 
$.historyLoad()
But I don&#039;t think those will work... is it onPageLoad?</description>
			<author>dummy@example.com (Zeroth)</author>
			<pubDate>Wed, 14 May 2008 15:05:10 +0000</pubDate>
			<guid>http://devkick.com/talk/post/22/#p22</guid>
		</item>
		<item>
			<title>Re: Galleria+jCarousel+ajax issues</title>
			<link>http://devkick.com/talk/post/21/#p21</link>
			<description>Hi Zeroth, welcome to the forums!

Do you have an example url? I&#039;m pretty sure you need to run the galleria script on each image load instead of just on DOM ready.</description>
			<author>dummy@example.com (David)</author>
			<pubDate>Wed, 14 May 2008 13:59:18 +0000</pubDate>
			<guid>http://devkick.com/talk/post/21/#p21</guid>
		</item>
		<item>
			<title>Galleria+jCarousel+ajax issues</title>
			<link>http://devkick.com/talk/post/20/#p20</link>
			<description>Currently, I am using Alex Wilson&#039;s combination of jCarousel and Galleria, in conjunction with a bit of background ajax. It just pulls a new image url wrapped in an img tag from the server, when needed, however, the new image box is not clickable. However, the hotkeys do work, meaning that galleria.next() and galleria.prev() work as expected, but, you just can&#039;t get the new images to expand. 

What do I need to do to get galleria to work with the new images, properly?</description>
			<author>dummy@example.com (Zeroth)</author>
			<pubDate>Wed, 14 May 2008 13:40:30 +0000</pubDate>
			<guid>http://devkick.com/talk/post/20/#p20</guid>
		</item>
	</channel>
</rss>
