<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Many Interests BLOG &#187; demo</title>
	<atom:link href="http://blog.darsain.net/tag/demo/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.darsain.net</link>
	<description>Too many things, too little time</description>
	<lastBuildDate>Sat, 03 Jul 2010 14:47:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>MyGallery 1.1 update</title>
		<link>http://blog.darsain.net/64/mygallery-1-1-update/</link>
		<comments>http://blog.darsain.net/64/mygallery-1-1-update/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 22:30:14 +0000</pubDate>
		<dc:creator>Darsain</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Freebies]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[MyGallery]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[Webdesign]]></category>

		<guid isPermaLink="false">http://blog.darsain.net/?p=64</guid>
		<description><![CDATA[As I&#8217;ve found some bugs in it, and I didn&#8217;t consider files uploading enough comfortable, I&#8217;ve decided to update this little thingy. New version is creating less mess on FTP (js &#038; style folders were moved into system), few bugs are fixed, few functionality clearance, but most important thing is new file uploader. I&#8217;ve implemented [...]]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;ve found some bugs in it, and I didn&#8217;t consider files uploading enough comfortable, I&#8217;ve decided to update this little thingy. New version is creating less mess on FTP (js &#038; style folders were moved into system), few bugs are fixed, few functionality clearance, but most important thing is new file uploader. I&#8217;ve implemented the GREAT <a href="http://www.uploadify.com/">jQuery Uploadify</a> plugin, which is creating THE most comfortable file uploading experience EVAR! :)</p>
<p><span id="more-64"></span></p>
<h3>New upload feature preview</h3>
<p><a href="http://blog.darsain.net/wp-content/uploads/2009/10/mygallery-uploadify.jpg" title="mygallery-uploadify" rel="lightbox[64]"><img src="http://blog.darsain.net/wp-content/uploads/2009/10/mygallery-uploadify-560x387.jpg" alt="mygallery-uploadify" title="mygallery-uploadify" width="560" height="387" class="alignleft size-large wp-image-65" /></a><br />
By calling files selection by flash, you can choose multiple files at once (or whole folder with Ctrl+a), which is not possible only with HTML~JS. That means, that you do not have to select all files one by one, and smash your head on keyboard after 101st image. All files are than inserted into an upload queue, which is triggered by the &#8220;Upload files&#8221; button. Everything is take care of by AJAX, so there is no need for site reloading, and you can see how you gallery is filling with images :)</p>
<a href="http://blog.darsain.net/?file_id=9" class="download-item">
  <img src="http://blog.darsain.net/wp-content/plugins/downloads-manager/img/icons/external.png" alt="icon">
  <h3>Demo presentation</h3>
  <span>1.09KB</span> <span>337x</span>
</a> <a href="http://blog.darsain.net/?file_id=10" class="download-item">
  <img src="http://blog.darsain.net/wp-content/plugins/downloads-manager/img/icons/archive.png" alt="icon">
  <h3>Application files</h3>
  <span>7.64KB</span> <span>197x</span>
</a>
<h3>Bugs &#038; suggestions</h3>
<p>Report all bugs here as comments (or as comments on main MyGallery page on www.darsain.net).</p>
<p>If you have some suggestion, or feature requests &#8230; same way as with bugs :) just write them down here.</p>
<h3>Future plans</h3>
<p>In the next update I would like to jump straight to version 2.0, because I want to redesign the whole thing, and change app structure. I would love to recreate it to looks and function more like Deviantart Portfolio application.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.darsain.net/64/mygallery-1-1-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thumbnail generation functions in PHP</title>
		<link>http://blog.darsain.net/61/thumbnail-generation-functions-in-php/</link>
		<comments>http://blog.darsain.net/61/thumbnail-generation-functions-in-php/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 20:06:00 +0000</pubDate>
		<dc:creator>Darsain</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[thumbnail]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.darsain.net/?p=61</guid>
		<description><![CDATA[First, lets take a look on what problem will this tutorial solve, so you can decide if you want to read more :)
We will write 2 functions for creating thumbnails from random image (png, jpg, gif). First function will take thumbnail width and height set by you, and cut the &#8220;most important&#8221; part from the [...]]]></description>
			<content:encoded><![CDATA[<p>First, lets take a look on what problem will this tutorial solve, so you can decide if you want to read more :)</p>
<p>We will write 2 functions for creating thumbnails from random image (png, jpg, gif). First function will take thumbnail width and height set by you, and cut the &#8220;most important&#8221; part from the image (I&#8217;m assuming, that you are creating thumbnails of websites, so center top is the area I&#8217;m talking about) according to thumbnail ratio, and resize it into your thumbnail in exact size that you&#8217;ve set. Second function will take max thumbnail width and height set by you, and resize the image so it will fit your max values, but with preserving its original resolution ratio.</p>
<p><span id="more-61"></span></p>
<h1>1.) Generate thumbnail of exact size</h1>
<p>This function will cut the biggest possible top center of image, so it can be resized into width and height you need without deforming it. The advantage of this method is, taht all thumbnails have same resolution, therefore they can be easily styled on website, and it just looks better. Disadvantage is, that sometimes, it could cut the important part of image.<br />
For better understanding, click on the image below.</p>
<p><a href="http://blog.darsain.net/wp-content/uploads/2009/10/thumb-cut-explanation.jpg" title="thumb-cut-explanation" rel="lightbox[61]"><img src="http://blog.darsain.net/wp-content/uploads/2009/10/thumb-cut-explanation-560x253.jpg" alt="thumb-cut-explanation" title="thumb-cut-explanation" width="560" height="253" class="alignleft size-large wp-image-62" /></a></p>
<p>Lets define the function:</p>
<p><strong>create_thumb( string <em>$source_path</em>, string <em>$destination_path</em>, int <em>$thumb_width</em>, int <em>$thumb_height</em> [, int <em>$quality</em> [, int <em>$overwrite</em>]] )</strong></p>
<h3>Parameters:</h3>
<ul>
<li><strong>$source_path</strong>: Path to source image (jpg, jpeg, png, gif).</li>
<li><strong>$destination_path</strong>: Thumbnail destination path. It has to have *.jpg extension, as all thumbnails will be generated in jpg.</li>
<li><strong>$thumb_width</strong>: Final thumbnail width.</li>
<li><strong>$thumb_height</strong>: Final thumbnail height.</li>
<li><strong>$quality</strong>: JPG compression quality (bigger: better quality,larger file). Range 0-100 (optimal 85).</li>
<li><strong>$overwrite</strong>: Set as true if you wan this function to overwrite thumbnail if it already exists.</li>
</ul>
<p>Lets start with code. I&#8217;m lazy to comment every line, so I&#8217;ll just paste the whole function with comments in code :) Also, I was asked about cut size and coordinates calculation, but I don&#8217;t know what is there to explain. If you suck in math,  than just copy paste it and live your miserable life :)</p>
<pre class="brush: php;">
function create_thumb( $source_path, $destination_path, $thumb_width, $thumb_height, $quality=85, $overwrite=true ) {

    // If overwrite is set to FALSE and destination file allready exists, than return FALSE and quit execution
    if( file_exists( $destination_path ) &amp;&amp; is_file( $destination_path ) &amp;&amp; $overwrite == false ) return false;

    // Needed definitions
    $allowed_extensions = array( 'jpg', 'jpeg', 'png', 'gif' );

    $pathinfo = pathinfo( $source_path );

    // Check if source file exists, and is in array of allowed extensions.
    // Otherwise return FALSE
    if( file_exists( $source_path ) &amp;&amp; in_array( strtolower( $pathinfo['extension'] ), $allowed_extensions ) )
    {

      // Get needed data about source image
      list( $original_width, $original_height, $type, $attr ) = getimagesize( $source_path );

      // Calculate cut size and coordinates
      $thumb_ratio = $thumb_width / $thumb_height;
      $original_ratio = $original_width / $original_height;

      if( $thumb_ratio &gt; $original_ratio )
      {

          $cut_width  = $original_width;
          $cut_height = ( $original_width * $thumb_height ) / $thumb_width;

          $cut_x = 0;
          $cut_y = 0;

      }
      elseif( $thumb_ratio &lt; $original_ratio )
      {

          $cut_width  = ( $original_height * $thumb_width ) / $thumb_height;
          $cut_height = $original_height;

          $cut_x = ( $original_width - $cut_width ) / 2;
          $cut_y = 0;

      }
      else
      {

          $cut_width  = $original_width;
          $cut_height = $original_height;

          $cut_x = 0;
          $cut_y = 0;

      }

      // Create final image layout
      $final_image = imagecreatetruecolor( $thumb_width, $thumb_height );

      // Is gif
      if( $pathinfo['extension'] == 'gif' )
      {
      	$source_image = imagecreatefromgif( $source_path );
      }
      // Is png
      elseif( $pathinfo['extension'] == 'png' )
      {
      	$source_image = imagecreatefrompng( $source_path );
      }
      // Is jpg, jpeg
      else
      {
      	$source_image = imagecreatefromjpeg( $source_path );
      }

      // Cut, resize source, and create final image
      imagecopyresampled( $final_image, $source_image, 0, 0, $cut_x, $cut_y, $thumb_width, $thumb_height, $cut_width, $cut_height );

      // Return TRUE if the thumbnail was created. Otherwise FALSE
      if ( imagejpeg( $final_image, $destination_path, $quality ) )
      {
        return true;
      }
      else
      {
        return false;
      }

    }
    else
    {
      return false;
    }

}
</pre>
<p>As you may notice, this function will always create a .jpg image. You can easily modify that to generate the same image type as source, but .jpg is simply the best choice for thumbnail, and it is not creating such mess on ftp as various image types. (If you are uploading animated gif, the first frame will be your thumbnail)</p>
<h1>1.) Generate thumbnail by original image resolution ratio</h1>
<p>This function will generate a thumbnail, which will fit into max thumbnail width and max height set by you, but also it will preserve the resolution image ratio of original, so it will be not deformed. Advantages and disadvantages of this method are exact opposite of previous one. Whole image is preserve in minified version, but on website, it could looks awful. Depends on how and where you are planning to use these thumbnails.<br />
For better understanding, click on the image below.</p>
<p><a href="http://blog.darsain.net/wp-content/uploads/2009/10/thumb-ratio-cut-explanation.jpg" title="thumb-ratio-cut-explanation" rel="lightbox[61]"><img src="http://blog.darsain.net/wp-content/uploads/2009/10/thumb-ratio-cut-explanation-560x253.jpg" alt="thumb-ratio-cut-explanation" title="thumb-ratio-cut-explanation" width="560" height="253" class="alignleft size-large wp-image-63" /></a></p>
<p>Definition and parameters are exactly same, just function is called <strong>create_ratio_thumb</strong>. Differences are highlighted.</p>
<pre class="brush: php; highlight: [19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,46,65];">
function create_ratio_thumb( $source_path, $destination_path, $thumb_width, $thumb_height, $quality=85, $overwrite=true ) {

    // If overwrite is set to FALSE and destination file allready exists, than return FALSE and quit execution
    if( file_exists( $destination_path ) &amp;&amp; is_file( $destination_path ) &amp;&amp; $overwrite == false ) return false;

    // Needed definitions
    $allowed_extensions = array( 'jpg', 'jpeg', 'png', 'gif' );

    $pathinfo = pathinfo( $source_path );

    // Check if source file exists, and is in array of allowed extensions.
    // Otherwise return FALSE
    if( file_exists( $source_path ) &amp;&amp; in_array( strtolower( $pathinfo['extension'] ), $allowed_extensions ) )
    {

      // Get needed data about source image
      list( $original_width, $original_height, $type, $attr ) = getimagesize( $source_path );

      // Calculate final thumbnail resolution
      $thumb_ratio = $thumb_width / $thumb_height;
      $original_ratio = $original_width / $original_height;

      if( $thumb_ratio &gt; $original_ratio )
      {

          $final_width  = round( ( $thumb_height * $original_width) / $original_height );
          $final_height = $thumb_height;

      }
      elseif( $thumb_ratio &lt; $original_ratio )
      {

          $final_width  = $thumb_width;
          $final_height = round( ( $thumb_width * $original_height ) / $original_width );

      }
      else
      {

          $final_width  = $thumb_width;
          $final_height = $thumb_height;

      }

      // Create final image layout
  		$final_image = imagecreatetruecolor( $final_width, $final_height );

  		// Is gif
  		if( $pathinfo['extension'] == 'gif' )
  		{
  			$source_image = imagecreatefromgif( $source_path );
  		}
  		// Is png
  		elseif( $pathinfo['extension'] == 'png' )
  		{
  			$source_image = imagecreatefrompng( $source_path );
  		}
  		// Is jpg, jpeg
  		else
  		{
  			$source_image = imagecreatefromjpeg( $source_path );
  		}

  		// Resize source, and create the final image
  		imagecopyresampled( $final_image, $source_image, 0, 0, 0, 0, $final_width, $final_height, $original_width, $original_height );

      // Return TRUE if the thumbnail was created. Otherwise FALSE
      if ( imagejpeg( $final_image, $destination_path, $quality ) )
      {
        return true;
      }
      else
      {
        return false;
      }

    }
    else
    {
      return false;
    }

}
</pre>
<p>And that would be our tutorial on creating thumbnails :) Check out the demo, where you can try to generate thumbnail from your own image, or download the tutorial files. (and don&#8217;t forget to set chmod 0777 to destination folder)</p>
<a href="http://blog.darsain.net/?file_id=7" class="download-item">
  <img src="http://blog.darsain.net/wp-content/plugins/downloads-manager/img/icons/external.png" alt="icon">
  <h3>Demo presentation</h3>
  <span></span> <span>355x</span>
</a> <a href="http://blog.darsain.net/?file_id=8" class="download-item">
  <img src="http://blog.darsain.net/wp-content/plugins/downloads-manager/img/icons/archive.png" alt="icon">
  <h3>Tutorial files</h3>
  <span>10.30KB</span> <span>214x</span>
</a>
]]></content:encoded>
			<wfw:commentRss>http://blog.darsain.net/61/thumbnail-generation-functions-in-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simple animated toggle with jQuery</title>
		<link>http://blog.darsain.net/38/simple-animated-toggle-with-jquery/</link>
		<comments>http://blog.darsain.net/38/simple-animated-toggle-with-jquery/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 20:11:00 +0000</pubDate>
		<dc:creator>Darsain</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Webdesign]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[animated toggle]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.darsain.net/?p=38</guid>
		<description><![CDATA[We all know about jQuery. Powerful and very popular JavaScript framework with many useful and great plugins. But the variety of plugins has created one bad behavior among webdevelopers. When they need to create some effect, or function, they are often looking for solution in plugins, instead of trying to do that on their own. [...]]]></description>
			<content:encoded><![CDATA[<p>We all know about jQuery. Powerful and very popular JavaScript framework with many useful and great plugins. But the variety of plugins has created one bad behavior among webdevelopers. When they need to create some effect, or function, they are often looking for solution in plugins, instead of trying to do that on their own. This simple search for simplified coding is creating mess in code, and forcing you to compromises in your layout, styling, or even website design. In this tutorial, we will create few lines of code, that can replace very popular plugin called Animated Collapsible DIV, or most of the plugins creating tabs.</p>
<p><span id="more-38"></span></p>
<a href="http://blog.darsain.net/?file_id=1" class="download-item">
  <img src="http://blog.darsain.net/wp-content/plugins/downloads-manager/img/icons/external.png" alt="icon">
  <h3>Demo presentation</h3>
  <span></span> <span>474x</span>
</a> <a href="http://blog.darsain.net/?file_id=2" class="download-item">
  <img src="http://blog.darsain.net/wp-content/plugins/downloads-manager/img/icons/archive.png" alt="icon">
  <h3>Tutorial files</h3>
  <span>24.93KB</span> <span>247x</span>
</a>
<p>First, we need to decide, how the animation will be triggered, and by what object. I&#8217;ve choose the solution of creating your own attributes (yeah, now you can&#8217;t masturbate over 100% W3C validation result you hypocritical bastard ;)), so the triggering object can be almost any tag. Animation will start after click on any object with my custom attribute &#8220;toggle&#8221;, and animated will be object with id equals toggle value. The whole HTML will look like this:</p>
<pre class="brush: xml;">
&lt;a href=&quot;#&quot; toggle=&quot;myObject&quot;&gt;Click me&lt;/a&gt;

&lt;div id=&quot;myObject&quot;&gt;
content ...
&lt;/div&gt;
</pre>
<p>Easy, huh? And as I already wrote, you can add this custom attribute to any object, like this:</p>
<pre class="brush: xml;">
&lt;a href=&quot;#&quot; toggle=&quot;myObject&quot;&gt;Click me&lt;/a&gt;
&lt;div toggle=&quot;myObject&quot;&gt;Click me&lt;/div&gt;
&lt;span toggle=&quot;myObject&quot;&gt;Click me&lt;/span&gt;
&lt;h1 toggle=&quot;myObject&quot;&gt;Click me&lt;/h1&gt;

&lt;div id=&quot;myObject&quot;&gt;
content ...
&lt;/div&gt;
</pre>
<p>All objects with attribute &#8220;toggle&#8221;, which is addressing to triggered object ID, are live buttons now.</p>
<p><strong><em>&#8220;But, what if I need to show one object, but close few others with some group, or something?&#8221;</em></strong></p>
<p>Nothing can be easier. We can add to targeted object another custom attribute called &#8220;group&#8221;, and give it the name of group as a value, so all the objects with this group will slide up, when another object is sliding down. Here is the HTML:</p>
<pre class="brush: xml;">
&lt;a href=&quot;#&quot; toggle=&quot;bread1&quot;&gt;I want some bread&lt;/a&gt;

&lt;div id=&quot;bread&quot; group=&quot;breakfast&quot;&gt;
content ...
&lt;/div&gt;

&lt;a href=&quot;#&quot; toggle=&quot;bread2&quot;&gt;What about milk?&lt;/a&gt;

&lt;div id=&quot;milk&quot; group=&quot;breakfast&quot;&gt;
content ...
&lt;/div&gt;
</pre>
<p>So, now, when we know how we want this to work, we can jump to creating our jQuery snippet.<br />
We need to trigger the click() function, when any object with the attribute &#8220;toggle&#8221; is clicked.</p>
<pre class="brush: jscript;">
$(&quot;[toggle]&quot;).click( function() {

});
</pre>
<p>Now, we need to define some variables to work with. Read the descriptions next to them.</p>
<pre class="brush: jscript;">
$(&quot;[toggle]&quot;).click( function() {

  var targetObjId = $(this).attr(&quot;toggle&quot;); // get the ID of targeted object from &quot;toggle&quot; attribute value
  var targetObj = $(&quot;[id=&quot;+targetObjId+&quot;]&quot;); // find and target the needed object into variable
  var targetObjGroup = $(targetObj).attr(&quot;group&quot;); // check, if tehre is any group reference on targeted object

});
</pre>
<p>We have our variables, so lets do some magic and finish the snippet. Again, read the comments in code.</p>
<pre class="brush: jscript;">
$(&quot;[toggle]&quot;).click( function() {

  var targetObjId = $(this).attr(&quot;toggle&quot;);
  var targetObj = $(&quot;[id=&quot;+targetObjId+&quot;]&quot;);
  var targetObjGroup = $(targetObj).attr(&quot;group&quot;);

  if( targetObjGroup ) // if there is some reference to group, run this
  {
      $(&quot;[group=&quot;+targetObjGroup+&quot;]&quot;).not(targetObj).slideUp(); // slide up (hide) all objects with refered group, but not our targetObj
      $(targetObj).slideDown(); // slide down (animated show function) our targetObj
  }
  else // if  there is no reference for group, run this
  {
      if( $(targetObj).is(&quot;:hidden&quot;) ) $(targetObj).slideDown(); // if our targetObj is hidden, slide him down
      else $(targetObj).slideUp(); // in other case, slide him up
  }

  return false; // in case that triggering object is an &lt;a&gt; tag, we don't want to href=&quot;&quot; got executed by browser

});
</pre>
<p>And thats it. This 19 lines of code can simply replace the whole Animated Collapsible DIV plugin. Interesting huh?</p>
<p>But this is not over yet :) In case, that you want to use this snippet as a tabs switcher, you have to do some changes, but you want to leave this snipped like it is, so simply copy paste it, and change the attribute to &#8220;showtab&#8221;. Here is the new snipped, with highlighted lines and explanations.</p>
<pre class="brush: jscript; highlight: [1,3,9,10,14,15];">
$(&quot;[showtab]&quot;).click( function() { // changed attribute

  var targetObjId = $(this).attr(&quot;showtab&quot;); // changed attribute
  var targetObj = $(&quot;[id=&quot;+targetObjId+&quot;]&quot;);
  var targetObjGroup = $(targetObj).attr(&quot;group&quot;);

  if( targetObjGroup )
  {
      $(&quot;[group=&quot;+targetObjGroup+&quot;]&quot;).not(targetObj).hide(); // in case of hiding tab, we don want to animate sliding, so it wouldn't mess with height of surrounding elements
      $(targetObj).fadeIn(); // fadeIn() animation is way better in tabs switching
  }
  else
  {
      if( $(targetObj).is(&quot;:hidden&quot;) ) $(targetObj).fadeIn(); // in case, that there is only one tab, just toggle it
      else $(targetObj).fadeOut();
  }

  return false;

});
</pre>
<p>If you need to change style of triggering button after click, just create a css class called &#8220;active&#8221; with needed changes, and toggle this class to button after if().</p>
<pre class="brush: jscript;">
$(&quot;[toggle]&quot;).click( function() {

  var targetObjId = $(this).attr(&quot;toggle&quot;);
  var targetObj = $(&quot;[id=&quot;+targetObjId+&quot;]&quot;);
  var targetObjGroup = $(targetObj).attr(&quot;group&quot;);

  if( targetObjGroup )
  { ... }
  else
  { ... }

  $(this).toggleclass('active'); // &lt;- thats what I'm talking about

  return false;

});
</pre>
<p>Or add this class with addclass(), and remove with removeclass() whenever in code you need.</p>
<p>I hope, that this tutorial will be useful for someone, and remember: Try to create some functions &#038; features yourself before finding the solution among plugins. That way, you will gain more experience, and know-hows.</p>
<p>As bonus, here are 2 simple snippets for &#8220;show&#8221; and &#8220;hide&#8221; attributes, for better understanding.</p>
<pre class="brush: jscript;">
$(&quot;[show]&quot;).click( function() {

  var targetObjId = $(this).attr(&quot;show&quot;);
  var targetObj = $(&quot;[id=&quot;+targetObjId+&quot;]&quot;);

  $(targetObj).slideDown();

});

$(&quot;[hide]&quot;).click( function() {

  var targetObjId = $(this).attr(&quot;hide&quot;);
  var targetObj = $(&quot;[id=&quot;+targetObjId+&quot;]&quot;);

  $(targetObj).slideUp();

});
</pre>
<p>If you have any questions, do not hesitate to ask. Comments are always welcome.</p>
<a href="http://blog.darsain.net/?file_id=1" class="download-item">
  <img src="http://blog.darsain.net/wp-content/plugins/downloads-manager/img/icons/external.png" alt="icon">
  <h3>Demo presentation</h3>
  <span></span> <span>474x</span>
</a> <a href="http://blog.darsain.net/?file_id=2" class="download-item">
  <img src="http://blog.darsain.net/wp-content/plugins/downloads-manager/img/icons/archive.png" alt="icon">
  <h3>Tutorial files</h3>
  <span>24.93KB</span> <span>247x</span>
</a>
]]></content:encoded>
			<wfw:commentRss>http://blog.darsain.net/38/simple-animated-toggle-with-jquery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
