<?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>JQuery, PHP, html, design... // arnaud-k : un blog de geek &#187; tutorial JQuery</title>
	<atom:link href="http://blog.arnaud-k.fr/tag/tutorial-jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.arnaud-k.fr</link>
	<description>Le blog JQuery, Html, Web Design</description>
	<lastBuildDate>Thu, 21 Apr 2011 08:10:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Plugin JQuery Uploadify : un tutorial vidéo pour l&#8217;upload multiple (par formamotion)</title>
		<link>http://blog.arnaud-k.fr/2010/09/15/plugin-jquery-uploadify-un-tutorial-video-pour-lupload-multiple-par-formamotion/</link>
		<comments>http://blog.arnaud-k.fr/2010/09/15/plugin-jquery-uploadify-un-tutorial-video-pour-lupload-multiple-par-formamotion/#comments</comments>
		<pubDate>Wed, 15 Sep 2010 12:51:43 +0000</pubDate>
		<dc:creator>arnaud</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[tuto video]]></category>
		<category><![CDATA[tutorial JQuery]]></category>

		<guid isPermaLink="false">http://blog.arnaud-k.fr/?p=1828</guid>
		<description><![CDATA[Formamotion, un site de tutoriels vidéos en français, propose un tuto vidéo de 12 minutes expliquant l&#8217;utilisation du plugin JQuery Uploadify permettant l&#8217;upload multiple de fichiers. Ce tutoriel explique l&#8217;utilisation du plugin et (le plus important) sa mise en place&#160;[...]</p> <p class="read-more"><a class="gray normal" href="http://blog.arnaud-k.fr/2010/09/15/plugin-jquery-uploadify-un-tutorial-video-pour-lupload-multiple-par-formamotion/">Lire la suite&#160;&#62;&#62;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2010%2F09%2F15%2Fplugin-jquery-uploadify-un-tutorial-video-pour-lupload-multiple-par-formamotion%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2010%2F09%2F15%2Fplugin-jquery-uploadify-un-tutorial-video-pour-lupload-multiple-par-formamotion%2F&amp;source=arnaudk&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img class="aligncenter size-full wp-image-1829" title="video-uploadify" src="http://blog.arnaud-k.fr/wp-content/uploads/2010/09/video-uploadify.jpg" alt="" width="600" height="266" /><a href="http://www.formamotion.com/index.html">Formamotion</a>, un site de tutoriels vidéos en français, <strong>propose un tuto vidéo de 12 minutes expliquant l&#8217;utilisation du<a href="http://www.uploadify.com/"> plugin JQuery Uploadify</a> permettant l&#8217;upload multiple de fichiers.</strong></p>
<p>Ce tutoriel explique l&#8217;utilisation du plugin et (le plus important) sa mise en place et sa configuration. Les 3 premières minutes où le plugin est présenté ne sont pas franchement très utiles contrairement aux explications qui arrivent après.</p>
<p><em>(j&#8217;ai rencontré des problèmes pour l&#8217;insertion de la vidéo en utilisant le code proposé par formamotion, chez moi elle ne fonctionne pas sous Firefox &#8211; Linux, tu peux toujours <a href="http://www.formamotion.com/formavideo,42,Uploadify-jQuery-upload-multiple-de-fichiers.html">la lire sur le site</a>)</em></p>
<div style="text-align:center">
<p>          <object type="application/x-shockwave-flash" width="600" height="480" allowscriptaccess="always" allowfullscreen="true"<br />
          flashvars="http://www.formamotion.com/video_flv.php?id=jquery_uploadify.flv"<br />
          data="http://www.formamotion.com/player.swf?showguidebutton=false&#038;showsharebutton=false&#038;brandname=FORMAMOTION&#038;brandlink=http://www.formamotion.com/"><param name="movie" value="http://www.formamotion.com/player.swf?showguidebutton=false&#038;showsharebutton=false&#038;brandname=FORMAMOTION&#038;brandlink=http://www.formamotion.com/" /><param value="true" name="allowfullscreen" /><param value="always" name="allowscriptaccess" /><param name="flashvars" value="file=http://www.formamotion.com/video_flv.php?id=jquery_uploadify.flv" /></object>      </p></div>
<p style="margin-top:20px;">
Enfin, tu peux également les 4 autres tutoriels vidéos disponibles sur le site en y faisant une <a href="http://www.formamotion.com/formavideos_recherche.html?recherche=jquery&#038;go=GO">recherche sur le mot JQuery</a> !</p>


<p>Pas encore de billet sur le même sujet !</p>]]></content:encoded>
			<wfw:commentRss>http://blog.arnaud-k.fr/2010/09/15/plugin-jquery-uploadify-un-tutorial-video-pour-lupload-multiple-par-formamotion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.formamotion.com/video_flv.php?id=jquery_uploadify.flv" length="0" type="video/flv" />
		</item>
		<item>
		<title>Tutorial JQuery : formulaire de recherche en Ajax</title>
		<link>http://blog.arnaud-k.fr/2010/09/14/tutorial-jquery-formulaire-de-recherche-en-ajax/</link>
		<comments>http://blog.arnaud-k.fr/2010/09/14/tutorial-jquery-formulaire-de-recherche-en-ajax/#comments</comments>
		<pubDate>Tue, 14 Sep 2010 11:00:24 +0000</pubDate>
		<dc:creator>arnaud</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[tutorial JQuery]]></category>

		<guid isPermaLink="false">http://blog.arnaud-k.fr/?p=1797</guid>
		<description><![CDATA[Chose promis, chose due, voici un tutorial pour faire un formulaire de recherche en Ajax avec JQuery et PHP. Idéal si vous avez envie de copier Google Instant, ce type de formulaire permet de faire gagner du temps à vos&#160;[...]</p> <p class="read-more"><a class="gray normal" href="http://blog.arnaud-k.fr/2010/09/14/tutorial-jquery-formulaire-de-recherche-en-ajax/">Lire la suite&#160;&#62;&#62;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2010%2F09%2F14%2Ftutorial-jquery-formulaire-de-recherche-en-ajax%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2010%2F09%2F14%2Ftutorial-jquery-formulaire-de-recherche-en-ajax%2F&amp;source=arnaudk&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://blog.arnaud-k.fr/wp-content/uploads/2010/09/ajax-search.jpg" alt="" title="Tutorial JQuery : formulaire de recherche en Ajax" width="600" height="230" class="aligncenter size-full wp-image-1810" /><br />
Chose promis, chose due, voici un tutorial pour faire un <strong>formulaire de recherche en Ajax avec JQuery et PHP</strong>. Idéal si vous avez envie de copier <a href="http://blog.arnaud-k.fr/2010/hors-sujet/autre/google-instant-search-la-recherche-plus-rapide/">Google Instant</a>, ce type de formulaire permet de faire gagner du temps à vos internautes. Et comme on commence à en voir un peu partout (Google, Youtube, Itunes&#8230;), il risque de devenir un standard.</p>
<p>Donc, comme d&#8217;habitude, j&#8217;ai préparé une démo du tutorial :<br />
<a class="demo" title="voir la demo du formulaire de recherche en Ajax" href="http://blog.arnaud-k.fr/demos/jquery-ajax-search/">Demo</a></p>
<p>Et c&#8217;est parti pour le code. On attaque donc par le code HTML de la page. On prépare le formulaire simplement, j&#8217;ai opté pour que l&#8217;on n&#8217;affiche pas le bouton soumission du formulaire. Et on ajoute un bloc vide, celui-ci contiendra les résultats éventuels.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!--debut du formulaire--&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ajax&quot;</span> <span style="color: #000066;">action</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;search.php&quot;</span> <span style="color: #000066;">method</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;get&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">label</span> <span style="color: #000066;">for</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;q&quot;</span>&gt;</span>Rechercher un article<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">label</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;q&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;q&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span>
<span style="color: #808080; font-style: italic;">&lt;!--fin du formulaire--&gt;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">&lt;!--preparation de l'affichage des resultats--&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;results&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<p>Ensuite le gros du code, le code JavaScript utilisant JQuery :</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #006600; font-style: italic;">// détection de la saisie dans le champ de recherche</span>
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#q'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">keyup</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $field <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#results'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// on vide les resultats</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#ajax-loader'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// on retire le loader</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">// on commence à traiter à partir du 2ème caractère saisie</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> $field.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">1</span> <span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #006600; font-style: italic;">// on envoie la valeur recherché en GET au fichier de traitement</span>
      $.<span style="color: #660066;">ajax</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
  	type <span style="color: #339933;">:</span> <span style="color: #3366CC;">'GET'</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">// envoi des données en GET ou POST</span>
	url <span style="color: #339933;">:</span> <span style="color: #3366CC;">'ajax-search.php'</span> <span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">// url du fichier de traitement</span>
	data <span style="color: #339933;">:</span> <span style="color: #3366CC;">'q='</span><span style="color: #339933;">+</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">// données à envoyer en  GET ou POST</span>
	beforeSend <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// traitements JS à faire AVANT l'envoi</span>
		$field.<span style="color: #660066;">after</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;img src=&quot;ajax-loader.gif&quot; alt=&quot;loader&quot; id=&quot;ajax-loader&quot; /&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// ajout d'un loader pour signifier l'action</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
	success <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// traitements JS à faire APRES le retour d'ajax-search.php</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#ajax-loader'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// on enleve le loader</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#results'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// affichage des résultats dans le bloc</span>
	<span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>		
  <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Et enfin le code du fichier &laquo;&nbsp;ajax-search.php&nbsp;&raquo; effectuant la recherche et le renvoi des éléments :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">//connexion à la base de données </span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_NAME'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'nom_de_la_base'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_USER'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'nom_utilisateur'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_PASSWORD'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'mot_de_passe'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_HOST'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'localhost'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$link</span>   <span style="color: #339933;">=</span>   <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span> DB_HOST <span style="color: #339933;">,</span> DB_USER <span style="color: #339933;">,</span> DB_PASSWORD <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span> DB_NAME <span style="color: #339933;">,</span> <span style="color: #000088;">$link</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//recherche des résultats dans la base de données</span>
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span>   <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'SELECT post_title , post_date , guid
                          FROM wp_posts
                          WHERE post_status = \'publish\'
                          AND post_title LIKE \''</span> <span style="color: #339933;">.</span> safe<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'q'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'%\'
                          LIMIT 0,20'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// affichage d'un message &quot;pas de résultats&quot;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">mysql_num_rows</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$result</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;h3 style=&quot;text-align:center; margin:10px 0;&quot;&gt;Pas de r&amp;eacute;sultats pour cette recherche&lt;/h3&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// parcours et affichage des résultats</span>
    <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$post</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_object</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$result</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">?&gt;</span>
        &lt;div class=&quot;article-result&quot;&gt;
            &lt;h3&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">guid</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;&lt; ?php echo utf8_encode( $post-&gt;post_title ); ?&gt;&lt;/a&gt;&lt;/h3&gt;
            &lt;p class=&quot;date&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_date</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/p&gt;
            &lt;p class=&quot;url&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">guid</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/p&gt;
        &lt;/div&gt;
    <span style="color: #000000; font-weight: bold;">&lt;?php</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/*****
fonctions
*****/</span>
<span style="color: #000000; font-weight: bold;">function</span> safe<span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$var</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_real_escape_string</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$var</span> <span style="color: #339933;">=</span> <span style="color: #990000;">addcslashes</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'%_'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$var</span> <span style="color: #339933;">=</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$var</span> <span style="color: #339933;">=</span> <span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$var</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$var</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Voilà, c&#8217;est tout pour ce tutoriel. Après il peut encore être optimisé en ajoutant des suggestions (toujours à la Google <img src='http://blog.arnaud-k.fr/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ). Mais on verra ça une autre fois !</p>


<p>Pas encore de billet sur le même sujet !</p>]]></content:encoded>
			<wfw:commentRss>http://blog.arnaud-k.fr/2010/09/14/tutorial-jquery-formulaire-de-recherche-en-ajax/feed/</wfw:commentRss>
		<slash:comments>46</slash:comments>
		</item>
		<item>
		<title>Faire une bande-annonce de film avec JQuery</title>
		<link>http://blog.arnaud-k.fr/2009/09/23/faire-une-bande-annonce-de-film-avec-jquery/</link>
		<comments>http://blog.arnaud-k.fr/2009/09/23/faire-une-bande-annonce-de-film-avec-jquery/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 10:11:52 +0000</pubDate>
		<dc:creator>arnaud</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[diaporama]]></category>
		<category><![CDATA[marcofolio]]></category>
		<category><![CDATA[tutorial JQuery]]></category>

		<guid isPermaLink="false">http://blog.arnaud-k.fr/?p=1463</guid>
		<description><![CDATA[Marcofolio propose sur son blog un tutorial JQuery pour créer un &#171;&#160;theatrical movie trailer&#160;&#187; (que j&#8217;ai librement traduit en &#171;&#160;bande-annonce de film&#160;&#187;). Le résultat final est assez bluffant, on croirait une vraei animation flash ! Avec des fondus enchainés, avec&#160;[...]</p> <p class="read-more"><a class="gray normal" href="http://blog.arnaud-k.fr/2009/09/23/faire-une-bande-annonce-de-film-avec-jquery/">Lire la suite&#160;&#62;&#62;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F09%2F23%2Ffaire-une-bande-annonce-de-film-avec-jquery%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F09%2F23%2Ffaire-une-bande-annonce-de-film-avec-jquery%2F&amp;source=arnaudk&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://demo.marcofolio.net/movie_trailer/"><img class="aligncenter size-full wp-image-1464" title="jquery-theatrical" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/09/jquery-theatrical.png" alt="jquery-theatrical" width="600" height="200" /></a></p>
<p>Marcofolio propose sur son blog<strong> un tutorial JQuery pour créer un &laquo;&nbsp;theatrical movie trailer&nbsp;&raquo;</strong> (que j&#8217;ai librement traduit en &laquo;&nbsp;bande-annonce de film&nbsp;&raquo;). <strong>Le résultat final est assez bluffant,</strong> on croirait une vraei animation flash ! Avec des fondus enchainés, avec du texte qui bouge&#8230;</p>
<p>Je pense juste que le poids total de l&#8217;anim est plus lourd que si elle avait été fait en flash, mais elle disponible même sans le flash (sur l&#8217;Iphone par exemple).</p>
<p><strong>Une <a href="http://demo.marcofolio.net/movie_trailer/">démo</a> est disponible</strong> sur le blog ainsi que le <a href="http://www.marcofolio.net/webdesign/theatrical_movie_trailer_with_jquery.html">tutorial</a> (tout le code est également dispo en téléchargement).</p>


<p>Pas encore de billet sur le même sujet !</p>]]></content:encoded>
			<wfw:commentRss>http://blog.arnaud-k.fr/2009/09/23/faire-une-bande-annonce-de-film-avec-jquery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tutorial plugin JQuery : Tweetable pour afficher le flux d&#8217;un membre Twitter</title>
		<link>http://blog.arnaud-k.fr/2009/09/03/tutorial-plugin-jquery-tweetable-pour-afficher-le-flux-dun-membre-twitter/</link>
		<comments>http://blog.arnaud-k.fr/2009/09/03/tutorial-plugin-jquery-tweetable-pour-afficher-le-flux-dun-membre-twitter/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 10:53:10 +0000</pubDate>
		<dc:creator>arnaud</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[plugin JQuery]]></category>
		<category><![CDATA[tutorial JQuery]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://blog.arnaud-k.fr/?p=1207</guid>
		<description><![CDATA[Le plugin JQuery Tweetable permet d&#8217;afficher le flux de tweets d&#8217;un membre de Twitter ultra-facilement ! En effet pour cela il suffit simplement de créer un &#60;div&#62; vide en lui donnant un id (ici l&#8217;id est égal à &#171;&#160;tweetable&#160;&#187;) :&#160;[...]</p> <p class="read-more"><a class="gray normal" href="http://blog.arnaud-k.fr/2009/09/03/tutorial-plugin-jquery-tweetable-pour-afficher-le-flux-dun-membre-twitter/">Lire la suite&#160;&#62;&#62;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F09%2F03%2Ftutorial-plugin-jquery-tweetable-pour-afficher-le-flux-dun-membre-twitter%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F09%2F03%2Ftutorial-plugin-jquery-tweetable-pour-afficher-le-flux-dun-membre-twitter%2F&amp;source=arnaudk&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img class="aligncenter size-full wp-image-1206" title="tweetable" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/09/tweetable.png" alt="tweetable" width="600" height="200" /></p>
<p>Le plugin JQuery <a href="http://theodin.co.uk/blog/javascript/tweetable-jquery-plugin.html">Tweetable</a><strong> permet d&#8217;afficher le flux de tweets d&#8217;un membre de Twitter ultra-facilement !</strong> En effet pour cela il suffit simplement de créer un &lt;div&gt; vide en lui donnant un id (ici l&#8217;id est égal à &laquo;&nbsp;tweetable&nbsp;&raquo;) :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;tweetable&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<p>Il faut ensuite importer le framework JQuery ainsi que le plugin dans la page HTML souhaité :</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;js/jquery.tweetable.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></div></div>

<p>Et enfin, il faut initialiser le plugin en sélectionnant le div voulu et en passant en option le nom d&#8217;utilisateur :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tweetable'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tweetable</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// on applique le plugin tweetable le bloc ayant pour id &quot;tweetable&quot;</span>
                           username<span style="color: #339933;">:</span> <span style="color: #3366CC;">'arnaudk'</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">// le nom d'utilisateur du flux Twitter à afficher</span>
                           time<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>  <span style="color: #006600; font-style: italic;">// pour afficher ou non la date des tweets (date en anglais)</span>
                           limit<span style="color: #339933;">:</span> <span style="color: #CC0000;">20</span> <span style="color: #006600; font-style: italic;">// nombre de tweets à afficher</span>
                <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>En bonus on peut ajouter quelques styles au code généré par le plugin JQuery :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#tweetable</span> li <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">13px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/twitter.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">8px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">list-style-type</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">dotted</span> <span style="color: #cc00cc;">#333</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#tweetable</span> <span style="color: #6666ff;">.hash</span> <span style="color: #00AA00;">&#123;</span> 
        <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#0066CC</span><span style="color: #00AA00;">;</span> 
<span style="color: #00AA00;">&#125;</span> 
&nbsp;
<span style="color: #cc00cc;">#tweetable</span> <span style="color: #6666ff;">.reply</span> <span style="color: #00AA00;">&#123;</span> 
        <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#0066CC</span><span style="color: #00AA00;">;</span> 
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Comme d&#8217;hab, j&#8217;ai <strong>préparé une petite démo</strong> avec le flux de mon Twitter (<a href="http://twitter.com/arnaudk">arnaudk</a>). A noter que <strong>le plugin a été fait par theodin et est <a href="http://theodin.co.uk/blog/javascript/tweetable-jquery-plugin.html">dispo en téléchargement</a> sur son blog !</strong><br />
<a href="http://blog.arnaud-k.fr/demos/tweetable/" class="demo" title="voir la demo de tweetable">voir la demo de tweetable</a></p>


<p>Pas encore de billet sur le même sujet !</p>]]></content:encoded>
			<wfw:commentRss>http://blog.arnaud-k.fr/2009/09/03/tutorial-plugin-jquery-tweetable-pour-afficher-le-flux-dun-membre-twitter/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Tutorial JQuery : personnaliser les cases à cocher (via aaronweyenberg.com)</title>
		<link>http://blog.arnaud-k.fr/2009/09/03/tutorial-jquery-personnaliser-les-cases-a-cocher-via-aaronweyenberg-com/</link>
		<comments>http://blog.arnaud-k.fr/2009/09/03/tutorial-jquery-personnaliser-les-cases-a-cocher-via-aaronweyenberg-com/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 06:55:22 +0000</pubDate>
		<dc:creator>arnaud</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[aaronweyenberg]]></category>
		<category><![CDATA[formulaire]]></category>
		<category><![CDATA[tutorial JQuery]]></category>

		<guid isPermaLink="false">http://blog.arnaud-k.fr/?p=1194</guid>
		<description><![CDATA[Sur le blog aaronweyenberg.com, Aaron propose un bon tutorial pour personnaliser les cases à cocher (de type checkbox) en utilisant JQuery et le CSS. Le résultat obtenu est bien pensé et très graphique. Il y a tous le code nécessaire&#160;[...]</p> <p class="read-more"><a class="gray normal" href="http://blog.arnaud-k.fr/2009/09/03/tutorial-jquery-personnaliser-les-cases-a-cocher-via-aaronweyenberg-com/">Lire la suite&#160;&#62;&#62;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F09%2F03%2Ftutorial-jquery-personnaliser-les-cases-a-cocher-via-aaronweyenberg-com%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F09%2F03%2Ftutorial-jquery-personnaliser-les-cases-a-cocher-via-aaronweyenberg-com%2F&amp;source=arnaudk&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://aaronweyenberg.com/90/pretty-checkboxes-with-jquery"><img class="aligncenter size-full wp-image-1196" title="checkboxes_jq" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/09/checkboxes_jq1.png" alt="checkboxes_jq" width="600" height="200" /></a></p>
<p>Sur le blog <a href="http://aaronweyenberg.com/90/pretty-checkboxes-with-jquery">aaronweyenberg.com</a>, Aaron propose un bon tutorial pour <strong>personnaliser les cases à cocher (de type checkbox) en utilisant JQuery et le CSS</strong>. Le résultat obtenu est bien pensé et très graphique. </p>
<p>Il y a tous le code nécessaire dans le tutoriel : HTML, CSS et JQuery. Le JQuery est bien commenté donc pas de problèmes pour comprendre le code ou pour une éventuelle adaptation. Of course, <strong>le tutoriel est en anglais et il une démo est disponible.</strong></p>
<p><a href="http://aaronweyenberg.com/demos/jqueryform/demo1.html" class="demo" title="voir la démo">Voir la démo</a></p>


<p>Pas encore de billet sur le même sujet !</p>]]></content:encoded>
			<wfw:commentRss>http://blog.arnaud-k.fr/2009/09/03/tutorial-jquery-personnaliser-les-cases-a-cocher-via-aaronweyenberg-com/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tutorial JQuery : créer un nuage de tag en pseudo 3d (via devirtuoso)</title>
		<link>http://blog.arnaud-k.fr/2009/08/17/tutorial-jquery-creer-un-nuage-de-tag-en-pseudo-3d-via-devirtuoso/</link>
		<comments>http://blog.arnaud-k.fr/2009/08/17/tutorial-jquery-creer-un-nuage-de-tag-en-pseudo-3d-via-devirtuoso/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 10:38:58 +0000</pubDate>
		<dc:creator>arnaud</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[devirtuoso]]></category>
		<category><![CDATA[lien]]></category>
		<category><![CDATA[tutorial JQuery]]></category>

		<guid isPermaLink="false">http://blog.arnaud-k.fr/?p=1170</guid>
		<description><![CDATA[Tutorial JQuery trouvé sur le blog devirtuoso : créer un nuage de tag en (pseudo) 3d. Le tutorial (en anglais) est bien expliqué et donne tout le code HTML, CSS et JQuery. Il est très simple de reproduire (ou de&#160;[...]</p> <p class="read-more"><a class="gray normal" href="http://blog.arnaud-k.fr/2009/08/17/tutorial-jquery-creer-un-nuage-de-tag-en-pseudo-3d-via-devirtuoso/">Lire la suite&#160;&#62;&#62;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F08%2F17%2Ftutorial-jquery-creer-un-nuage-de-tag-en-pseudo-3d-via-devirtuoso%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F08%2F17%2Ftutorial-jquery-creer-un-nuage-de-tag-en-pseudo-3d-via-devirtuoso%2F&amp;source=arnaudk&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://www.devirtuoso.com/2009/08/how-to-create-a-3d-tag-cloud-in-jquery/"><img class="aligncenter size-full wp-image-1171" title="jquery-nuage" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/08/jquery-nuage.png" alt="jquery-nuage" width="600" height="200" /></a></p>
<p>Tutorial JQuery trouvé sur le blog devirtuoso : <a href="http://www.devirtuoso.com/2009/08/how-to-create-a-3d-tag-cloud-in-jquery/">créer un nuage de tag en (pseudo) 3d</a>. <strong>Le tutorial (en anglais) est bien expliqué et donne tout le code HTML, CSS et JQuery</strong>. Il est très simple de reproduire (ou de repartir) du code donné, le code étant propre.</p>
<p>L&#8217;effet ainsi réalisé peut être une très bonn alternative au plugin pour flash (<a href="http://www.roytanck.com/2008/05/19/wp-cumulus-update/">wp-cumulus</a> pour WordPress) qui affiche aussi un nuage de tags en 3d. Mais cela reste du flash avec les désagréments que l&#8217;on connaît (la SEO notamment). Mais wp-cumulus reste au final plus joli et plus ergonomique.</p>
<p>A noter que l&#8217;on trouve aussi sur le blog une <a href="http://www.devirtuoso.com/2009/08/jquery-animated-wave/">variante avec un effet de &laquo;&nbsp;vagues&nbsp;&raquo;</a> (sympa mais pas très ergonomique !)</p>


<p>Pas encore de billet sur le même sujet !</p>]]></content:encoded>
			<wfw:commentRss>http://blog.arnaud-k.fr/2009/08/17/tutorial-jquery-creer-un-nuage-de-tag-en-pseudo-3d-via-devirtuoso/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tutorial : un diaporama JQuery facile et simple avec le plugin JQuery Slideshow</title>
		<link>http://blog.arnaud-k.fr/2009/08/11/tutorial-un-diaporama-jquery-facile-et-simple-avec-le-plugin-jquery-slideshow/</link>
		<comments>http://blog.arnaud-k.fr/2009/08/11/tutorial-un-diaporama-jquery-facile-et-simple-avec-le-plugin-jquery-slideshow/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 08:46:43 +0000</pubDate>
		<dc:creator>arnaud</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[diaporama]]></category>
		<category><![CDATA[plugin JQuery]]></category>
		<category><![CDATA[tutorial JQuery]]></category>

		<guid isPermaLink="false">http://blog.arnaud-k.fr/?p=1140</guid>
		<description><![CDATA[Le plugin JQuery Slideshow permet de créer un diaporama très simplement. Il n&#8217;y a qu&#8217;un seul effet de transition : le fondu enchainé (fadeIn/fadeOut) et un seul à paramètre à régler : le temps de défilement des images. Pour le&#160;[...]</p> <p class="read-more"><a class="gray normal" href="http://blog.arnaud-k.fr/2009/08/11/tutorial-un-diaporama-jquery-facile-et-simple-avec-le-plugin-jquery-slideshow/">Lire la suite&#160;&#62;&#62;</a></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F08%2F11%2Ftutorial-un-diaporama-jquery-facile-et-simple-avec-le-plugin-jquery-slideshow%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.arnaud-k.fr%2F2009%2F08%2F11%2Ftutorial-un-diaporama-jquery-facile-et-simple-avec-le-plugin-jquery-slideshow%2F&amp;source=arnaudk&amp;style=compact&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img class="aligncenter size-full wp-image-1141" title="jquery-slideshow" src="http://blog.arnaud-k.fr/wp-content/uploads/2009/08/jquery-slideshow.png" alt="jquery-slideshow" width="600" height="200" /></p>
<p>Le plugin JQuery <a href="http://www.matto1990.com/jquery/slideshow/">Slideshow</a><strong> permet de créer un diaporama très simplement</strong>. Il n&#8217;y a qu&#8217;un seul effet de transition : le fondu enchainé (fadeIn/fadeOut) et un seul à paramètre à régler : le temps de défilement des images.</p>
<p>Pour le code HTML, c&#8217;est tout ce qu&#8217;il y a de plus simple, on prend un bloc (auquel on donne un id pour le sélectionner avec JQuery) dans lequel on ajoute des images (avec la balise&#8230; &lt;img /&gt; !) :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;slideshow&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;image1.jpg&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;image 1&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;image2.jpg&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;image 2&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;image3.jpg&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;image 3&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;image4.jpg&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;image 4&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;image5.jpg&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;image 5&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;image6.jpg&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;image 6&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;image7.jpg&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;image 7&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<p>Et pour le JQuery, c&#8217;est aussi simple car il n&#8217;y a qu&#8217;un seul paramètre. <strong>Le plugin Slideshow s&#8217;occupe de tout le reste :</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#slideshow'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideshow</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// on applique le diaporama sur le bloc ayant pour id 'slideshow'</span>
		timeout<span style="color: #339933;">:</span> <span style="color: #CC0000;">1500</span> <span style="color: #006600; font-style: italic;">// chaque image restera affiché 1 500 millisecondes (soit 1.5 seconde)</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><strong>Un plugin tout simple mais diablement efficace !</strong></p>


<p>Pas encore de billet sur le même sujet !</p>]]></content:encoded>
			<wfw:commentRss>http://blog.arnaud-k.fr/2009/08/11/tutorial-un-diaporama-jquery-facile-et-simple-avec-le-plugin-jquery-slideshow/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

