<?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>&#8235;Htm - אחלה טיפים לבניית אתרים &#187; jQuery&#8236;</title>	<atom:link href="http://www.htm.co.il/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.htm.co.il</link>
	<description>&#8235;מדריכים ומאמרים בנושא בניית אתרים. כל יום משהו חדש ללמוד, וליישם.&#8236;</description>	<lastBuildDate>Wed, 18 Jan 2012 09:32:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>il</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>&#8235;הוספת כתוביות לתגית וידאו&#8236;</title>		<link>http://www.htm.co.il/2009/12/15/%d7%94%d7%95%d7%a1%d7%a4%d7%aa-%d7%9b%d7%aa%d7%95%d7%91%d7%99%d7%95%d7%aa-%d7%9c%d7%aa%d7%92%d7%99%d7%aa-%d7%95%d7%99%d7%93%d7%90%d7%95/</link>
		<comments>http://www.htm.co.il/2009/12/15/%d7%94%d7%95%d7%a1%d7%a4%d7%aa-%d7%9b%d7%aa%d7%95%d7%91%d7%99%d7%95%d7%aa-%d7%9c%d7%aa%d7%92%d7%99%d7%aa-%d7%95%d7%99%d7%93%d7%90%d7%95/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 14:48:31 +0000</pubDate>
		<dc:creator>&#8235;אורן רוט&#8236;</dc:creator>				<category><![CDATA[בניית אתרים]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[וידאו]]></category>

		<guid isPermaLink="false">http://www.htm.co.il/?p=973</guid>
		<description><![CDATA[&#8235;השבוע דפדפן פיירפוקס חגג 5 שנים להיווסדו, בדף האינטרנט שהוקם לחגיגה ראיתי סרטון בפורמט פתוח שמתנגן עם כתוביות. ישר חיפשתי את אופן הפעולה לשילוב הכתוביות וכמובן שמצאתי. במדריך היום אני אסביר לכם כיצד להוסיף כתוביות לתגית video באמצעות קוד JS.&#8236;]]></description>			<content:encoded><![CDATA[<div dir="rtl"><p>הוספת כתוביות לסרטון וידאו זה בהחלט לא דבר חדש. בטכניקת <strong>הארדסאב </strong>(<em>hard-sub</em>) ניתן לצרוב את הכתוביות על גבי הסרטון ולעלות אותו לאינטרנט ובטכניקת <strong>סופטפאב</strong> (<em>soft-sub</em>) ניתן להציג סרטון עם כתוביות באמצעות שילוב של טכנולוגיית פלאש. מה שאני אלמד אתכם היום היא טכניקת סופטסאב להוספת כתוביות לסרטון המתנגן בתגית וידאו. </p>
<p>במדריך היום אנו נשתמש בסרטון וידאו בפורמט <strong>OGG</strong> או <strong>OGV </strong>(פורמט OGV הוא למעשה מקרה פרטי של OGG מכיוון ו-OGG יכול להתייחס גם לסאונד) ובכתוביות בפורמט SRT.  </p>
<p>היתרונות של הטכניקה שנלמד היום היא שהיא משתמשת בפורמטים פתוחים (OGG ו-SRT), היישום שלה מאוד פשוט ודינאמי ובתוך קובץ הכתוביות אנחנו יכולים לשלב תגיות HTML שיופיעו מאוחר יותר כחלק מן הכתוביות.</p>
<div id="DemoAndCodeBtns"><a id="demoLink" href="http://htm.co.il/lab/videoSub" target="_blank"><span>&lt;</span>דוגמא<span>&gt;</span></a><a href="http://htm.co.il/lab/videoSub/videoSub.rar" target="_blank"><span>&lt;</span>קוד<span>&gt;</span></a></div>
<h3>קוד ה-HTML</h3>
<p>בואו תחילה נביט בקוד ה-HTML:</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:580px;height:auto;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; <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><span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; <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;video_subtitles.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span><br />
<br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">style</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; #subtitle {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; background-color: rgba(255, 255, 255, 0.7);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; padding:10px 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; position: absolute;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bottom: 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; width: 100%;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; color: black;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; visibility: hidden;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; font-size: 1em;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; text-align:center;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; direction:rtl;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; #video {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; width:432px;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; height:240px;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; direction:ltr;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">style</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;video <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;video&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;video5.ogv&quot;</span> controls<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> subtitles<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;en.srt&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span>video&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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;subtitle&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;visibility: hidden;&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></div></td></tr></tbody></table></div>
<p>וכעת ההסבר. בשורה 4 אנחנו למעשה מוסיפים כהרגלנו בקודש את ספריית ה-jQuery מתוך google. בשורה הבא אנחנו נוסיף את הסקריפט שיגרום לכל הכתוביות להופיע (מקורהסקריפט הוא מהבלוג <a href="http://blog.mozbox.org/post/2009/03/10/video-tag-and-subtitles">mozbox</a>). </p>
<p>לאחר מכן בין שורות 7-26 אנחנו מגדירים עיצוב CSS לוידאו ולשורת הכתוביות, אני לא ארחיב על נושא העיצוב.  </p>
<p>ועכשיו הגענו לעיקר, שורות 32-33 בואו נביט בהם שוב:</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:580px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;video <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;video&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;video5.ogv&quot;</span> controls<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> subtitles<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;en.srt&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span>video&gt;</span><br />
<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;subtitle&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;visibility: hidden;&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></div></td></tr></tbody></table></div>
<p>הוספנו למעשה שני דברים:</p>
<p><strong> תגית וידאו -</strong> התגית מכילה id בשם video, קישור לקובץ הוידאו (בפורמט OGV), לחצני פעולה (המאפיין controls לא צריך לקבל שום ערך) וקישור לקובץ הכתוביות שלנו (בפורמט SRT).</p>
<p><strong>אלמנט div ריק -</strong> האלמנט מכיל id בשם subtitles והוא מוסתר.</p>
<p>אם פעלתם לפי כל ההוראות עד עכשיו צריך להיות גם לכם סרטון עם כתוביות. אתם מוזמנים להוריד את קבצי המקור ולהביט בקוד הJS שמפעיל את הכתוביות.</p>
<div class="warning"><strong>שימו לב! </strong>הסרטון נתמך אך ורק בדפדפנים מודרנים שתומכים בתגית video (תקן HTML 5). קרי <strong>Firefox 3.1/3.5</strong> או <strong>chorme</strong>.</div>
<h3>עוד באותו נושא:</h3><ul class="related_post"><li  class="relatedPost"><a href="http://www.htm.co.il/2010/02/28/%d7%91-2010-%d7%90%d7%a0%d7%97%d7%a0%d7%95-%d7%a2%d7%95%d7%91%d7%a8%d7%99%d7%9d-%d7%9c-offline/" title="<!--:il-->ב-2010 אנחנו עוברים ל-Offline<!--:-->"><img src="http://htm.co.il/wp-content/post-images/1045.jpg" /><!--:il-->ב-2010 אנחנו עוברים ל-Offline<!--:--></a><div style="clear: both;"></div></li><li  class="relatedPost"><a href="http://www.htm.co.il/2009/11/15/%d7%9e%d7%a4%d7%aa-%d7%90%d7%aa%d7%a8-%d7%a6%d7%91%d7%a2%d7%95%d7%a0%d7%99%d7%aa-%d7%91%d7%a2%d7%96%d7%a8%d7%aa-jquery/" title="מפת אתר צבעונית בעזרת jQuery"><img src="http://htm.co.il/wp-content/post-images/859.jpg" />מפת אתר צבעונית בעזרת jQuery</a><div style="clear: both;"></div></li></ul></div>]]></content:encoded>			<wfw:commentRss>http://www.htm.co.il/2009/12/15/%d7%94%d7%95%d7%a1%d7%a4%d7%aa-%d7%9b%d7%aa%d7%95%d7%91%d7%99%d7%95%d7%aa-%d7%9c%d7%aa%d7%92%d7%99%d7%aa-%d7%95%d7%99%d7%93%d7%90%d7%95/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>&#8235;מפת אתר צבעונית בעזרת jQuery&#8236;</title>		<link>http://www.htm.co.il/2009/11/15/%d7%9e%d7%a4%d7%aa-%d7%90%d7%aa%d7%a8-%d7%a6%d7%91%d7%a2%d7%95%d7%a0%d7%99%d7%aa-%d7%91%d7%a2%d7%96%d7%a8%d7%aa-jquery/</link>
		<comments>http://www.htm.co.il/2009/11/15/%d7%9e%d7%a4%d7%aa-%d7%90%d7%aa%d7%a8-%d7%a6%d7%91%d7%a2%d7%95%d7%a0%d7%99%d7%aa-%d7%91%d7%a2%d7%96%d7%a8%d7%aa-jquery/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 10:25:32 +0000</pubDate>
		<dc:creator>&#8235;אורן רוט&#8236;</dc:creator>				<category><![CDATA[בניית אתרים]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[מפת אתר]]></category>

		<guid isPermaLink="false">http://www.htm.co.il/?p=859</guid>
		<description><![CDATA[&#8235;היום הכנתי לכם מדריך וידאו ליצירת מפת אתר צבעונית, לא סתם צבעונית, אלא לפי מיקום העכבר. אולי סקריפט כזה יחייה קצת את מפות האתר שברוב המקרים, משמשות את מנועי החיפוש הרבה יותר מאשר את הגולשים באתר.&#8236;]]></description>			<content:encoded><![CDATA[<div dir="rtl"><p>בתור בוני אתרים אנחנו נתקלנו לא פעם אחת בצורך ליצירת מפת אתר, אם זו מפת אתר XML או מפת אתר מעוצבת. הסיבות לבניית מפות אתר הם מגוונות, סיפוק מנועי החיפוש ועזרה לגולש בניווט באתר. למרות שהצורך המקורי ליצירת מפות אתר היה דווקא השני (עזרה למנווט באתר), היום כמעט ולא נראה גולשים מנווטים דרך מפת האתר. אם את שואלים מה הסיבה לכך, לדעתי, מפות אתר פשוט לא ידיותיות למשתמש. בסרטון ההדכה שאני אתן לכם היום אני מסביר איך להוסיף קוד jQuery דינמאי ופשוט, על-מנת ליצור מפת אתר ידודתית יותר ומסודרת יותר. את המדריך הזה לקחתי מכריס קויר מאתר <a href="http://css-tricks.com/">css-tricks</a>, שפרסם מאמר על הטכניקה הזו באתר Smashing Magazine.</p>
<div id="DemoAndCodeBtns"><a id="demoLink" href="http://htm.co.il/lab/colorSitemap" target="_blank"><span>&lt;</span>דוגמא<span>&gt;</span></a><a href="http://htm.co.il/lab/colorSitemap/colorSitemap.rar" target="_blank"><span>&lt;</span>קוד<span>&gt;</span></a></div>
<p><strong>ברשותכם חילקתי את הסרטון לשני חלקים, כל חלק כ-5 דקות:</strong><br />
<object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="600" height="337"><param name="movie" value="/jw/player-viral.swf" /><param name="allowfullscreen" value="true" /><param name="wmode" value="transparent" /><param name="allowscriptaccess" value="always" /><param name="flashvars" value="author=Htm.co.il&#038;description=מפת אתר צבעונית באמצעות jQuery&#038;duration=9:50&#038;file=http://htm.co.il/lab/colorSitemap/sitemap1.mp4&#038;image=http://www.htm.co.il/wp-content/video-images/859.jpg&#038;title=מפת אתר צבעונית באמצעות jQuery&#038;frontcolor=ffffff&#038;lightcolor=0092BA&#038;logo=http://htm.co.il/logo.png&#038;skin=/jw/overlay.swf&#038;controlbar=over&#038;dock=true&#038;stretching=none" /><embed  src='/jw/player-viral.swf'  width='600'  height='337'	wmode="transparent"  bgcolor='#'  allowscriptaccess='always'  allowfullscreen='true'  flashvars='author=Htm.co.il&#038;description=מפת אתר צבעונית באמצעות jQuery&#038;duration=9:50&#038;file=http://htm.co.il/lab/colorSitemap/sitemap1.mp4&#038;image=http://www.htm.co.il/wp-content/video-images/859.jpg&#038;title=מפת אתר צבעונית באמצעות jQuery&#038;frontcolor=ffffff&#038;lightcolor=0092BA&#038;logo=http://htm.co.il/logo.png&#038;skin=/jw/overlay.swf&#038;controlbar=over&#038;dock=true&#038;stretching=none' /><br />
	</object></p>
<p><object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="600" height="337"><param name="movie" value="/jw/player-viral.swf" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="wmode" value="transparent" /><param name="flashvars" value="author=Htm.co.il&#038;description=מפת אתר צבעונית באמצעות jQuery&#038;duration=9:50&#038;file=http://htm.co.il/lab/colorSitemap/sitemap2.mp4&#038;image=http://www.htm.co.il/wp-content/video-images/859-2.jpg&#038;title=מפת אתר צבעונית באמצעות jQuery&#038;frontcolor=ffffff&#038;lightcolor=0092BA&#038;logo=http://htm.co.il/logo.png&#038;skin=/jw/overlay.swf&#038;controlbar=over&#038;dock=true&#038;stretching=none" /><embed  src='/jw/player-viral.swf'  width='600'  height='337'	wmode="transparent"  bgcolor='#'  allowscriptaccess='always'  allowfullscreen='true'  flashvars='author=Htm.co.il&#038;description=מפת אתר צבעונית באמצעות jQuery&#038;duration=9:50&#038;file=http://htm.co.il/lab/colorSitemap/sitemap2.mp4&#038;image=http://www.htm.co.il/wp-content/video-images/859-2.jpg&#038;title=מפת אתר צבעונית באמצעות jQuery&#038;frontcolor=ffffff&#038;lightcolor=0092BA&#038;logo=http://htm.co.il/logo.png&#038;skin=/jw/overlay.swf&#038;controlbar=over&#038;dock=true&#038;stretching=none' /><br />
	</object></p>
<p>להלן התכנים שהוסברו בסרטון:</p>
<p><strong>HTML</strong></p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:580px;height:auto;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span><br />
&nbsp; &nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Content-Type&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/html; charset=windows-1255&quot;</span>&gt;</span>&nbsp; <br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;../demoStyle.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">media</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;screen, projection&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <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><span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">style</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span>&gt;</span><br />
&nbsp; &nbsp; * &nbsp; &nbsp; &nbsp;{ margin: 0; padding: 0; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; body &nbsp; { font: 14px Georgia, serif; background: #222; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; h1,p &nbsp; {color:#e6e6e6;}<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; a &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { text-decoration: none; color: #eee; display: block; padding: 4px 0;}<br />
&nbsp; &nbsp; &nbsp; &nbsp; a:hover &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { text-decoration: underline;color: #eee; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; ul{ <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; padding: 8px 25px; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; list-style: none;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; background: #282828; <br />
&nbsp; &nbsp; &nbsp; &nbsp; } <br />
&nbsp; &nbsp; &nbsp; &nbsp; ul ul &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { background: #393939; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; ul ul ul&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { background: #4b4b4b; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; ul ul ul ul &nbsp; &nbsp; &nbsp; &nbsp; { background: #5a5a5a; }<br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">style</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;js/jquery.color.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;js/sitemap.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;push-2&quot;</span>&gt;</span><br />
&nbsp; &nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/category/בניית_אתרים&quot;</span>&gt;</span>בניית אתרים<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/tag/html-5&quot;</span>&gt;</span>HTML 5<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/2009/10/26/html-5-מה-נכנס-ומה-יוצא-חלק-א/&quot;</span>&gt;</span>HTML 5 – מה נכנס ומה יוצא? – חלק א'<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/category/חדשות/&quot;</span>&gt;</span>הרצאות<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/2009/11/13/סיכום-של-יום-השימושיות/&quot;</span>&gt;</span>כנס יום ה-Usability<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/2009/09/28/סיכום-מפגש-העשרה-של-איגוד-האינטרנט-היש&quot;</span>&gt;</span>סיכום מפגש העשרה של איגוד האינטרנט הישראלי 2009<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span> <span style="color: #808080; font-style: italic;">&lt;!-- END הרצאות --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/2009/10/26/html-5-מה-נכנס-ומה-יוצא-חלק-ב/&quot;</span>&gt;</span>HTML 5 – מה נכנס ומה יוצא? – חלק ב' <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span> <span style="color: #808080; font-style: italic;">&lt;!-- END HTML 5 --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/2009/09/22/ולידציה-נעה-לשליחת-טפסים/&quot;</span>&gt;</span>ולידציה נעה לשליחת טפסים<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/2009/10/25/קוד-קצר-להצגת-תוכן-תיקייה&quot;</span>&gt;</span>קוד קצר להצגת תוכן תיקייה<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/tag/jquery/&quot;</span>&gt;</span>jQuery<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/2009/10/21/תיבת-הצעות-לשורת-טקסט-בעזרת-תוסף-json-ו-jquery&quot;</span>&gt;</span>תיבת הצעות לשורת טקסט בעזרת תוסף JSON ו-jQuery<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/2009/10/22/הפיכת-טופס-לתהליך-הרשמה/&quot;</span>&gt;</span>הפיכת טופס לתהליך הרשמה<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/2009/10/14/שיתוף-תכנים-בגרירה&quot;</span>&gt;</span>שיתוף תכנים בגרירה<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/2009/09/30/היפוך-של-אנגלית-לעברית-באמצעות-ajax&quot;</span>&gt;</span>היפוך של אנגלית לעברית באמצעות AJAX<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span> <span style="color: #808080; font-style: italic;">&lt;!-- END jQuery --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/2009/09/19/שינוי-כתובות-עם-mod_rewrite&quot;</span>&gt;</span>שינוי כתובות עם mod_rewrite<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/2009/09/23/יישום-שינוי-כתובות-עם-mod_rewrite-פרק-ב/&quot;</span>&gt;</span>יישום שינוי כתובות עם mod_rewrite – פרק ב'<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/2009/09/17/fusion-charts-דרך-יפה-להציג-נתונים/&quot;</span>&gt;</span>Fusion Charts – דרך יפה להציג נתונים <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span> <span style="color: #808080; font-style: italic;">&lt;!-- END בניית אתרים --&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/category/עיצוב_אתרים/&quot;</span>&gt;</span>עיצוב אתרים<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/category/חדשות/&quot;</span>&gt;</span>חדשות<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;/category/המלצות/&quot;</span>&gt;</span>המלצות<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span><br />
&nbsp; &nbsp; <br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></div></td></tr></tbody></table></div>
<p><strong>JavaScipt &#8211; sitemap.js</strong></p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:580px;height:auto;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<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><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ul&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;opacity&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;0.7&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ul&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">doFade</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> fadeColor <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;#362b40&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ul ul&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">doFade</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> fadeColor <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;#354668&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ul ul ul&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">doFade</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> fadeColor <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;#304531&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ul ul ul ul&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">doFade</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> fadeColor <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;#72352d&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
jQuery.<span style="color: #660066;">fn</span>.<span style="color: #660066;">doFade</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>settings<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<br />
&nbsp; &nbsp;settings <span style="color: #339933;">=</span> jQuery.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; fadeColor<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;black&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; duration<span style="color: #339933;">:</span> 200<span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; fadeOn<span style="color: #339933;">:</span> 0.95<span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; fadeOff<span style="color: #339933;">:</span> 0.7<br />
&nbsp; &nbsp;<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> settings<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> duration <span style="color: #339933;">=</span> settings.<span style="color: #660066;">duration</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> fadeOff <span style="color: #339933;">=</span> settings.<span style="color: #660066;">fadeOff</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> fadeOn <span style="color: #339933;">=</span> settings.<span style="color: #660066;">fadeOn</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> fadeColor <span style="color: #339933;">=</span> settings.<span style="color: #660066;">fadeColor</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
$<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;">hover</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><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; .<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; .<span style="color: #660066;">data</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;origColor&quot;</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;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;background-color&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; .<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; opacity<span style="color: #339933;">:</span> fadeOn<span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; backgroundColor<span style="color: #339933;">:</span> fadeColor<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>duration<span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><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><br />
&nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; .<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; .<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; opacity<span style="color: #339933;">:</span> fadeOff<span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; backgroundColor<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;">data</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;origColor&quot;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>duration<span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<h3>עוד באותו נושא:</h3><ul class="related_post"><li  class="relatedPost"><a href="http://www.htm.co.il/2009/12/15/%d7%94%d7%95%d7%a1%d7%a4%d7%aa-%d7%9b%d7%aa%d7%95%d7%91%d7%99%d7%95%d7%aa-%d7%9c%d7%aa%d7%92%d7%99%d7%aa-%d7%95%d7%99%d7%93%d7%90%d7%95/" title="<!--:il-->הוספת כתוביות לתגית וידאו<!--:--><!--:en-->Adding subtitles to a video tag<!--:-->"><img src="http://htm.co.il/wp-content/post-images/973.jpg" /><!--:il-->הוספת כתוביות לתגית וידאו<!--:--><!--:en-->Adding subtitles to a video tag<!--:--></a><div style="clear: both;"></div></li><li  class="relatedPost"><a href="http://www.htm.co.il/2009/10/22/%d7%94%d7%a4%d7%99%d7%9b%d7%aa-%d7%98%d7%95%d7%a4%d7%a1-%d7%9c%d7%aa%d7%94%d7%9c%d7%99%d7%9a-%d7%94%d7%a8%d7%a9%d7%9e%d7%94/" title="הפיכת טופס לתהליך הרשמה"><img src="http://htm.co.il/wp-content/post-images/714.jpg" />הפיכת טופס לתהליך הרשמה</a><div style="clear: both;"></div></li></ul></div>]]></content:encoded>			<wfw:commentRss>http://www.htm.co.il/2009/11/15/%d7%9e%d7%a4%d7%aa-%d7%90%d7%aa%d7%a8-%d7%a6%d7%91%d7%a2%d7%95%d7%a0%d7%99%d7%aa-%d7%91%d7%a2%d7%96%d7%a8%d7%aa-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8235;הפיכת טופס לתהליך הרשמה&#8236;</title>		<link>http://www.htm.co.il/2009/10/22/%d7%94%d7%a4%d7%99%d7%9b%d7%aa-%d7%98%d7%95%d7%a4%d7%a1-%d7%9c%d7%aa%d7%94%d7%9c%d7%99%d7%9a-%d7%94%d7%a8%d7%a9%d7%9e%d7%94/</link>
		<comments>http://www.htm.co.il/2009/10/22/%d7%94%d7%a4%d7%99%d7%9b%d7%aa-%d7%98%d7%95%d7%a4%d7%a1-%d7%9c%d7%aa%d7%94%d7%9c%d7%99%d7%9a-%d7%94%d7%a8%d7%a9%d7%9e%d7%94/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 07:38:31 +0000</pubDate>
		<dc:creator>&#8235;אורן רוט&#8236;</dc:creator>				<category><![CDATA[בניית אתרים]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[טפסים]]></category>

		<guid isPermaLink="false">http://www.htm.co.il/?p=714</guid>
		<description><![CDATA[&#8235;טפסים ארוכים עלולים להיות מייגעים ואי-ידידותיים למשתמש. בעזרת הטמעה של קוד jQuery פשוט תוכלו לחלק את הטופס שלכם לשלבים הגיוניים וליצור אצל המשתמש חווית גלישה טובה יותר.&#8236;]]></description>			<content:encoded><![CDATA[<div dir="rtl"><p>בהרבה אתרים, במיוחד אתרי קניות, אנחנו נתקלים בטפסים ארוכים. הטפסים מכילים פרטים אישיים, פרטי חשבון, פרטי משלוח ועוד ועוד ועוד. בהרבה מקרים צריך לגלול מטה מכיוון והטופס גבוה יותר מגובה העמוד. כל התיאור הנ&quot;ל יוצר תוצאה לא כל-כך נוחה ורצויה, בהתחשב בכך שאנחנו מעוניינים שבסוף התהליך המשתמש ימלא את פרטי האשראי שלו וישלח לנו את כספו הטוב. אפשר אחרת! במדריך הבא אני אתן לכם פלאגין שהופך טופס פשוט, לתהליך של הרשמה שמחולק לפי שלבים ונושאים.</p>
<p>לפני הכל אני חייב לציין שאת הקוד לקחתי מאתר אהוב עליי &quot;<a href="http://www.jankoatwarpspeed.com/post/2009/09/28/webform-wizard-jquery.aspx">ג'אנקו את וורפ ספיד</a>&quot;, החלפתי את האנגלית לעברית ועכשיו אתם יכולים להשתמש בזה בקלות.</p>
<div id="DemoAndCodeBtns"><a id="demoLink" href="http://htm.co.il/lab/formWizard" target="_blank"><span>&lt;</span>דוגמא<span>&gt;</span></a><a href="http://htm.co.il/lab/formWizard/formWizard.rar" target="_blank"><span>&lt;</span>קוד<span>&gt;</span></a></div>
<h3>מה אנחנו צריכים?</h3>
<p>טופס. זה כמעט ומספיק, עוד דבר אחר שאנחנו צריכים לוודא שהטופס מחולק ל<a href="http://htmldog.com/reference/htmltags/fieldset/">fieldset</a> שלכל אחד יש <a href="http://htmldog.com/reference/htmltags/legend/">legend</a>. בואו נביט במבנה:</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:580px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;SignupForm&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">fieldset</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">legend</span>&gt;</span>פרטי חשבון<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">legend</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; //...חלק אחד....<br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">fieldset</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">fieldset</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">legend</span>&gt;</span>פרטי חברה<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">legend</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; //...חלק שני...<br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">fieldset</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">fieldset</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">legend</span>&gt;</span>פרטי תשלום<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">legend</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; //...חלק שלישי...<br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">fieldset</span>&gt;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;SaveAccount&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;שלח טופס&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> &nbsp; &nbsp;<br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span></div></td></tr></tbody></table></div>
<p>המהות של fieldset הוא לחלק את הטופס לחלקים, בתוך כל fieldset אנחנו נתחום חלקי טופס הקשורים אחד לשני (הוא מחלק את הטופס לקבוצות). תפקיד ה-legend הוא לתת כותרת ל-fielset, הוא חייב לבוא מיד לאחר פתיחת התאג fieldset.</p>
<p>זה הכל מבחינת ה-HTML. כעת כל שעלינו לעשות זה להוסיף את הקוד ה-jQuery (שהורדתם בכפתור הקוד למעלה), ולהפעיל אותו על הטופס הרצוי. מה שקוד ה-JS שאנחנו נתמיע יעשה, זה להציג כל פעם fieldset שונה, ובעזרת הכפתורים שהסקריפט יצור יהיה אפשר לנווט בין ה-fieldsets.</p>
<h3>הוספת קוד הפלאגין</h3>
<p>ראשית נוסיף שלושה קבצים חיוניים:</p>
<ul>
<li>jQuery</li>
<li>סקריפט הפיכת טופס לתהליך (formToWizard.js)</li>
<li>גליון עיצוב לתהליך (formToWizard.css)</li>
</ul>
<p>ככה זה נראה (בין תגיות ה-Head):</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:580px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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><span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span><br />
<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;formToWizard.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;formToWizard.css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></div></td></tr></tbody></table></div>
<p>כעת נוסיף את קוד ההפעלה (נשים לב שלמעלה ה-ID של ה-form הוא <strong>SignupForm</strong> וה-ID של כפתור השליחה הוא <strong>SaveAccount</strong>):</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:580px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; $<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><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<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><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#SignupForm&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">formToWizard</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> submitButton<span style="color: #339933;">:</span> <span style="color: #3366CC;">'SaveAccount'</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
<p>כעת הטופס אמור להפוך לתהליך. את השם לכל תהליך הוא לוקח מה-legend של כל fieldset.</p>
<p>זה הכל! אני ממש אהבתי את הסקריפט הזה מכיוון והוא לא מתערב (פולשני) בתוך קוד ה-HTML, ונותן מענה אמיתי לטפסים ארוכים.</p>
<h4 style="margin-bottom:15px">מה איתכם? אהבתם? חושבים שהסקריפט שימושי? אשמח לשמוע על כך בתגובות!</h4>
<h3>עוד באותו נושא:</h3><ul class="related_post"><li  class="relatedPost"><a href="http://www.htm.co.il/2009/09/22/%d7%95%d7%9c%d7%99%d7%93%d7%a6%d7%99%d7%94-%d7%a0%d7%a2%d7%94-%d7%9c%d7%a9%d7%9c%d7%99%d7%97%d7%aa-%d7%98%d7%a4%d7%a1%d7%99%d7%9d/" title="ולידציה נעה לשליחת טפסים"><img src="http://htm.co.il/wp-content/post-images/502.jpg" />ולידציה נעה לשליחת טפסים</a><div style="clear: both;"></div></li><li  class="relatedPost"><a href="http://www.htm.co.il/2009/12/15/%d7%94%d7%95%d7%a1%d7%a4%d7%aa-%d7%9b%d7%aa%d7%95%d7%91%d7%99%d7%95%d7%aa-%d7%9c%d7%aa%d7%92%d7%99%d7%aa-%d7%95%d7%99%d7%93%d7%90%d7%95/" title="<!--:il-->הוספת כתוביות לתגית וידאו<!--:--><!--:en-->Adding subtitles to a video tag<!--:-->"><img src="http://htm.co.il/wp-content/post-images/973.jpg" /><!--:il-->הוספת כתוביות לתגית וידאו<!--:--><!--:en-->Adding subtitles to a video tag<!--:--></a><div style="clear: both;"></div></li></ul></div>]]></content:encoded>			<wfw:commentRss>http://www.htm.co.il/2009/10/22/%d7%94%d7%a4%d7%99%d7%9b%d7%aa-%d7%98%d7%95%d7%a4%d7%a1-%d7%9c%d7%aa%d7%94%d7%9c%d7%99%d7%9a-%d7%94%d7%a8%d7%a9%d7%9e%d7%94/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>&#8235;תיבת הצעות לשורת טקסט בעזרת תוסף JSON ו-jQuery&#8236;</title>		<link>http://www.htm.co.il/2009/10/21/%d7%aa%d7%99%d7%91%d7%aa-%d7%94%d7%a6%d7%a2%d7%95%d7%aa-%d7%9c%d7%a9%d7%95%d7%a8%d7%aa-%d7%98%d7%a7%d7%a1%d7%98-%d7%91%d7%a2%d7%96%d7%a8%d7%aa-%d7%aa%d7%95%d7%a1%d7%a3-json-%d7%95-jquery/</link>
		<comments>http://www.htm.co.il/2009/10/21/%d7%aa%d7%99%d7%91%d7%aa-%d7%94%d7%a6%d7%a2%d7%95%d7%aa-%d7%9c%d7%a9%d7%95%d7%a8%d7%aa-%d7%98%d7%a7%d7%a1%d7%98-%d7%91%d7%a2%d7%96%d7%a8%d7%aa-%d7%aa%d7%95%d7%a1%d7%a3-json-%d7%95-jquery/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 09:59:57 +0000</pubDate>
		<dc:creator>&#8235;אורן רוט&#8236;</dc:creator>				<category><![CDATA[בניית אתרים]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[json]]></category>

		<guid isPermaLink="false">http://www.htm.co.il/?p=707</guid>
		<description><![CDATA[&#8235;היום הקלטתי לכבודכם מדריך וידאו שמסביר כיצד אפשר להשתמש בתוסף JSON SUGGEST BOX על מנת להוסיף לכל שורת טקסט, תיבת הצעות המופיעה בזמן ההקלדה.&#8236;]]></description>			<content:encoded><![CDATA[<div dir="rtl"><p>במדריך הוידאו הבא אני אספר לכם כיצד תוכלו להוסיף תוסף פשוט לשורת טקטס וליצור שורת טקסט דינאמית. התוסף גורם לכך שכאשר מקלידים אות בשורת הטקסט מופיעות הצעות מתחת לתיבת עם אפשרויות השלמה למה שהקלידו בשורת הטקסט. אפשר להוסיף תמונה ואפשר גם להוסיף תיאור.</p>
<div id="DemoAndCodeBtns"><a id="demoLink" href="http://htm.co.il/lab/suggestBox" target="_blank"><span>&lt;</span>דוגמא<span>&gt;</span></a><a href="http://htm.co.il/lab/suggestBox/suggestBox.rar" target="_blank"><span>&lt;</span>קוד<span>&gt;</span></a></div>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="345" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="flashvars" value="i=20620" /><param name="allowFullScreen" value="true" /><param name="src" value="http://screenr.com/Content/assets/screenr_0817090731.swf" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="560" height="345" src="http://screenr.com/Content/assets/screenr_0817090731.swf" allowfullscreen="true" flashvars="i=20620"></embed></object></p>
<p><strong>לינקים קשורים לסרטון:</strong></p>
<ul>
<li><a href="http://plugins.jquery.com/project/jsonsuggest">הורדת התוסף מאתר jQuery</a></li>
</ul>
<p><strong>קוד:</strong></p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:580px;height:auto;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;css/jsonSuggest.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">media</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;screen, projection&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <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;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;suggest&quot;</span> <span style="color: #000066;">size</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;40&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;margin:3px -2px;&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <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><span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">language</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;JavaScript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;js/jquery.jsonSuggest.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">language</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;JavaScript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;js/json2.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var mySuggestions = [<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; text: 'דלישס',<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; image: 'icons/Delicious.png',<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; extra: 'דוגמא מתוך אתר <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://htm.co.il&quot;</span>&gt;</span>htm.co.il<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; text: 'דיג',<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; image: 'icons/Digg.png',<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; extra: 'דוגמא מתוך אתר <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://htm.co.il&quot;</span>&gt;</span>htm.co.il<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; text: 'פליקר',<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; image: 'icons/Flickr.png',<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; extra: 'דוגמא מתוך אתר <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://htm.co.il&quot;</span>&gt;</span>htm.co.il<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; text: 'מיספייס',<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; image: 'icons/MySpace.png',<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; extra: 'דוגמא מתוך אתר <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://htm.co.il&quot;</span>&gt;</span>htm.co.il<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; text: 'יוטיוב',<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; image: 'icons/Youtube.png',<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; extra: 'דוגמא מתוך אתר <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://htm.co.il&quot;</span>&gt;</span>htm.co.il<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; text: 'רדיט',<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; image: 'icons/Reddit.png',<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; extra: 'דוגמא מתוך אתר <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://htm.co.il&quot;</span>&gt;</span>htm.co.il<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; text: 'סטמבל-אפון',<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; image: 'icons/StumbleUpon.png',<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; extra: 'דוגמא מתוך אתר <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://htm.co.il&quot;</span>&gt;</span>htm.co.il<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; text: 'טוויטר',<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; image: 'icons/Twitter.png',<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; extra: 'דוגמא מתוך אתר <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://htm.co.il&quot;</span>&gt;</span>htm.co.il<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(function(){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $('#suggest').jsonSuggest(mySuggestions);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></div></td></tr></tbody></table></div>
<h3>עוד באותו נושא:</h3><ul class="related_post"><li  class="relatedPost"><a href="http://www.htm.co.il/2009/12/15/%d7%94%d7%95%d7%a1%d7%a4%d7%aa-%d7%9b%d7%aa%d7%95%d7%91%d7%99%d7%95%d7%aa-%d7%9c%d7%aa%d7%92%d7%99%d7%aa-%d7%95%d7%99%d7%93%d7%90%d7%95/" title="<!--:il-->הוספת כתוביות לתגית וידאו<!--:--><!--:en-->Adding subtitles to a video tag<!--:-->"><img src="http://htm.co.il/wp-content/post-images/973.jpg" /><!--:il-->הוספת כתוביות לתגית וידאו<!--:--><!--:en-->Adding subtitles to a video tag<!--:--></a><div style="clear: both;"></div></li><li  class="relatedPost"><a href="http://www.htm.co.il/2009/11/15/%d7%9e%d7%a4%d7%aa-%d7%90%d7%aa%d7%a8-%d7%a6%d7%91%d7%a2%d7%95%d7%a0%d7%99%d7%aa-%d7%91%d7%a2%d7%96%d7%a8%d7%aa-jquery/" title="מפת אתר צבעונית בעזרת jQuery"><img src="http://htm.co.il/wp-content/post-images/859.jpg" />מפת אתר צבעונית בעזרת jQuery</a><div style="clear: both;"></div></li></ul></div>]]></content:encoded>			<wfw:commentRss>http://www.htm.co.il/2009/10/21/%d7%aa%d7%99%d7%91%d7%aa-%d7%94%d7%a6%d7%a2%d7%95%d7%aa-%d7%9c%d7%a9%d7%95%d7%a8%d7%aa-%d7%98%d7%a7%d7%a1%d7%98-%d7%91%d7%a2%d7%96%d7%a8%d7%aa-%d7%aa%d7%95%d7%a1%d7%a3-json-%d7%95-jquery/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>&#8235;שיתוף תכנים בגרירה&#8236;</title>		<link>http://www.htm.co.il/2009/10/14/%d7%a9%d7%99%d7%aa%d7%95%d7%a3-%d7%aa%d7%9b%d7%a0%d7%99%d7%9d-%d7%91%d7%92%d7%a8%d7%99%d7%a8%d7%94/</link>
		<comments>http://www.htm.co.il/2009/10/14/%d7%a9%d7%99%d7%aa%d7%95%d7%a3-%d7%aa%d7%9b%d7%a0%d7%99%d7%9d-%d7%91%d7%92%d7%a8%d7%99%d7%a8%d7%94/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 09:22:46 +0000</pubDate>
		<dc:creator>&#8235;אורן רוט&#8236;</dc:creator>				<category><![CDATA[בניית אתרים]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[גרירה]]></category>
		<category><![CDATA[מתנה]]></category>
		<category><![CDATA[שיתוף]]></category>

		<guid isPermaLink="false">http://www.htm.co.il/?p=680</guid>
		<description><![CDATA[&#8235;לאחר פגרה ארוכה של חגים, היום אני נותן לכם במתנה קוד שבניתי לשיתוף תכנים באמצעות גרירה. כל שעליכם לעשות הוא להוסיף מאפיין class לתוכן השיתופי, והמבקרים באתרכם יוכלו לגרור ולשתף בקלות ובנוחות.&#8236;]]></description>			<content:encoded><![CDATA[<div dir="rtl"><p>שיתוף תכנים היא אחת המאפיינים של רשת האינטרנט, הכל משותף. ראית משהו יפה או מעניין, כנראה זה כבר בדרך לרשימת התפוצה שלך במייל, מפורסם בפייסבוק או שלחת טוויט בנושא. בתור בעלי אתרים, יש לנו אינטרס גדול מאוד להגדיל את שיתוף התכנים מתוך האתר שלנו. המתמטיקה פשוטה, יותר שיתוף = יותר כניסות לאתר. באמצעות התמאת הקוד שאני אתן לכם כאן, תוכלו להוסיף class וכותרת לקטעי וידאו או תמונות ובאמצעות קוד jQuery יתווסף לשונית קטנה בשם: &quot;שתף בגרירה!&quot;, לכל וידאו או תמונה.</p>
<div id="DemoAndCodeBtns"><a id="demoLink" href="http://htm.co.il/lab/dragShare" target="_blank"><span>&lt;</span>דוגמא<span>&gt;</span></a><a href="http://htm.co.il/lab/dragShare/dragShare.rar" target="_blank"><span>&lt;</span>קוד<span>&gt;</span></a></div>
<div></div>
<div>
<div class="wp-caption alignnone" style="width: 510px"><img title="Drag &amp; Share" src="http://www.htm.co.il/wp-content/uploads/2009/10/dragShare.png" alt="שיתוף תכנים באמצעות גרירה" width="500" height="372" /><p class="wp-caption-text">שיתוף תכנים באמצעות גרירה</p></div>
</div>
<p>את הרעיון לסקריפט הזה שאבתי מאתר meebo. הם יצרו סקריפט דומה (קצת יותר משוכלל) שמאפשר לשתף בגרירה, שלחתי להם מייל בבקשה לקבל את הקוד לשימוש באתר שלי, אך הם סירבו לעת עתה. לא יכלתי לבזבז זמן אז פשוט החלטתי לבנות את הסקריפט בעצמי ובעברית.<br />
אם תסתכלו ב<a href="http://htm.co.il/lab/dragShare">דוגמא</a>, תוכלו לראות שמעל לסרטון ישנה תווית קטנה שאומרת, &quot;שתפו בגרירה!&quot;. כאשר ננסה לגרור את התווית, המסך יוחשך ויופיע תפריט עם ארבע אפשרויות: <strong>טוויטר</strong>, <strong>פייסבוק</strong>, <strong>גוגל </strong>ו<strong>אימייל</strong>. עם נשחרר את התווית שגררנו על כל אחת מן האפשרויות, תפתח לנו לשונית חדשה בדפדפן שמציגה את מסך השיתוף של האתר הנבחר, כל השדות של השיתוף כבר מוזנים כל שנותר על המשתמש לעשות הוא ללחוץ שלח.</p>
<h3>איך מטמיעים את הקוד</h3>
<p>דבר ראשון שצריך לעשות הוא ל<a href="http://htm.co.il/lab/dragShare/dragShare.rar">הוריד את כל קבצי הקוד</a> מהקישור כאן הוא למעלה (קוד). לאחר שנפתח את קובץ ה-rar נראה שמה שהקבצים שהורדנו הם:</p>
<ul>
<li>dragShare.js</li>
<li>dragShare.css</li>
<li>קובץ html</li>
<li>תיקיית js</li>
<li>תיקיית תמונות</li>
</ul>
<p>על מנת שהקוד יפעל, אנו צריכים לטעון לתוך האתר שלנו את תיקיית ה-JS וכמו כן את שתי הקבצים הראשונים (קובץ JS וקובץ CSS).</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:580px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #006600; font-style: italic;">//ספריות jQuery &nbsp; </span><br />
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/jquery-1.3.2.min.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span><br />
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/ui.core.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span><br />
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/ui.draggable.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span><br />
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js/ui.droppable.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span><br />
<br />
<span style="color: #006600; font-style: italic;">//שני הקבצים הראשונים</span><br />
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;dragShare.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span><br />
<span style="color: #339933;">&lt;</span>link rel<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;stylesheet&quot;</span> type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/css&quot;</span> href<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;dragShare.css&quot;</span> <span style="color: #339933;">/&gt;</span></div></td></tr></tbody></table></div>
<p>ארבעת קבצי ה-JS הראשונים בגררנו הם (לפי הסדר): ספריית jQuery, ספריית <acronym title="User Interface">UI</acronym> של jQuery, ספריית גרירה וספריית השמטה. לאחר מכן טענו את קוד ה-JS שאני הכנתי (חשוב מאוד לשמור על סדר הטעינה הזה).</p>
<p>האמת שאנחנו ממש קרובים לסוף, לאחר שטענו את הקבצים החיוניים, כל שעלינו לעשות הוא למצוא אלמנט מסוג object או img ולהוסיף לו שני משתנים: class ו-title.</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:580px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">object</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;share&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;שיתוף תכנים באמצעות גרירה&quot;</span> ...&gt;</span></div></td></tr></tbody></table></div>
<p>בדוגמא זו הוספנו תווית גרירה לאלמנט של וידאו, object. המאפיין class צריך להכיל את הערך &quot;share&quot; והמאפיין title צריך להכיל את הכותרת המתאימה לתוכן המשותף (כותרת זו תוצג כאשר ישתפו את התוכן).</p>
<p>זה הכל! כעת לאחר טעינת העמוד, קוד jQuery יעבור אוטומטית על כל האלמנטים שמכילים class=&quot;share&quot; ויוסיף להם תווית גרירה.<br />
תטמיעו את הקוד באתרכם ותזמינו את המבקרים באתרכם לשתף בגרירה.</p>
<h3>עוד באותו נושא:</h3><ul class="related_post"><li  class="relatedPost"><a href="http://www.htm.co.il/2009/12/15/%d7%94%d7%95%d7%a1%d7%a4%d7%aa-%d7%9b%d7%aa%d7%95%d7%91%d7%99%d7%95%d7%aa-%d7%9c%d7%aa%d7%92%d7%99%d7%aa-%d7%95%d7%99%d7%93%d7%90%d7%95/" title="<!--:il-->הוספת כתוביות לתגית וידאו<!--:--><!--:en-->Adding subtitles to a video tag<!--:-->"><img src="http://htm.co.il/wp-content/post-images/973.jpg" /><!--:il-->הוספת כתוביות לתגית וידאו<!--:--><!--:en-->Adding subtitles to a video tag<!--:--></a><div style="clear: both;"></div></li><li  class="relatedPost"><a href="http://www.htm.co.il/2009/11/15/%d7%9e%d7%a4%d7%aa-%d7%90%d7%aa%d7%a8-%d7%a6%d7%91%d7%a2%d7%95%d7%a0%d7%99%d7%aa-%d7%91%d7%a2%d7%96%d7%a8%d7%aa-jquery/" title="מפת אתר צבעונית בעזרת jQuery"><img src="http://htm.co.il/wp-content/post-images/859.jpg" />מפת אתר צבעונית בעזרת jQuery</a><div style="clear: both;"></div></li></ul></div>]]></content:encoded>			<wfw:commentRss>http://www.htm.co.il/2009/10/14/%d7%a9%d7%99%d7%aa%d7%95%d7%a3-%d7%aa%d7%9b%d7%a0%d7%99%d7%9d-%d7%91%d7%92%d7%a8%d7%99%d7%a8%d7%94/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>&#8235;היפוך של אנגלית לעברית באמצעות AJAX&#8236;</title>		<link>http://www.htm.co.il/2009/09/30/%d7%94%d7%99%d7%a4%d7%95%d7%9a-%d7%a9%d7%9c-%d7%90%d7%a0%d7%92%d7%9c%d7%99%d7%aa-%d7%9c%d7%a2%d7%91%d7%a8%d7%99%d7%aa-%d7%91%d7%90%d7%9e%d7%a6%d7%a2%d7%95%d7%aa-ajax/</link>
		<comments>http://www.htm.co.il/2009/09/30/%d7%94%d7%99%d7%a4%d7%95%d7%9a-%d7%a9%d7%9c-%d7%90%d7%a0%d7%92%d7%9c%d7%99%d7%aa-%d7%9c%d7%a2%d7%91%d7%a8%d7%99%d7%aa-%d7%91%d7%90%d7%9e%d7%a6%d7%a2%d7%95%d7%aa-ajax/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 08:35:40 +0000</pubDate>
		<dc:creator>&#8235;אורן רוט&#8236;</dc:creator>				<category><![CDATA[בניית אתרים]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[תווים]]></category>

		<guid isPermaLink="false">http://www.htm.co.il/?p=627</guid>
		<description><![CDATA[&#8235;קרה לכם פעם שרציתם לכתוב בעברית אבל כל מה שהוצג שהרמתם את הראש היה, TU; ZV AUC ERV. במדריך הזה אני מציע פתרון שמשלב AJAX ו-jQuery וגורם לתיבת טקסט להחליף כל תו שנכנס אליה באנגלית לתו המקביל העברי שלה (במקלדת).&#8236;]]></description>			<content:encoded><![CDATA[<div dir="rtl"><p>אתם בטוח מכירים את זה שאתם רוצים לכתוב טקסט בעברית ואז במקום &quot;לא נראה לי&quot; אתם מקבלים על המסך &quot;kt brtv kh&quot;, אבל לא לפני שהחבר לידכם מספיק להוציא צעקת יאוש של &quot;אווו אוו אוו, אתה כותב באנגלית&quot;. אם הזדהתם עם הראשון אז אתם בטוח מכירים את זה שיש שדות טקסט מסויימים שמוכנים לקבל רק עברית, אז עד שימציאו שדות יעודיים לשפה אחת (אולי HTML5?) אני מגיש לכם כאן פתרון פשוט למימוש, שיגרום להחלפה מידית של טקסט שמוזן באנגלית בשדה מסויים לעברית.</p>
<div id="DemoAndCodeBtns"><a href="http://htm.co.il/lab/ajaxText" target="_blank" id="demoLink"><span>&lt;</span>דוגמא<span>&gt;</span></a><a href="http://htm.co.il/lab/ajaxText/ajaxText.rar" target="_blank"><span>&lt;</span>קוד<span>&gt;</span></a></div>
<p>חוץ מבאתר &quot;אגד&quot; אני לא זוכר איפה ראיתי דוגמא לשדה טקסט שהופך תווים באנגלית לעברית, תוך כדי הזנתם. מה שאגד עשו שם ואני מימשתי בדוגמא הזאת, הוא למעשה שדה טקסט פשוט שמאפשר להכניס לתוכו רק תווים בשפה העברית וכאשר מנסים להכניס תווים בשפה האנגלית הוא הופך תוך כדי (בלי שהגולש אפילו שם לב) את התווים לעברית.<br />
מה שטוב בקוד כזה הוא שהוא חוסך הרבה זמן לגולש (ותסכול) במידה והוא טעה, וכן נותן אינדקציה לכך ששדה הטקסט הנוכחי חייב להיות בעברית בלבד.</p>
<p>בואו נעבור כעת לקוד, אנחנו נתחיל עם ה-HTML:</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:580px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span><br />
...<br />
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span><br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;&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;textHeb&quot;</span>&gt;</span>הכנס כאן את הטקסט (כדאי לנסות אנגלית): <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">label</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">textarea</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;textHeb&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;textHeb&quot;</span> <span style="color: #000066;">onkeyup</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ajaxFunction();&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">textarea</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span><br />
&nbsp; &nbsp; ....<br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></div></td></tr></tbody></table></div>
<p>כל מה שיצרנו זה טופס ובתוכו textarea עם ID ושם-&quot;textHeb&quot;.  בנוסף הוספנו לו קריאה לפונקציה ajaxFunction (שאותה ניצור בהמשך) כאשר לוחצים על תו &#8211; כלומר, כאשר מקלידים בתוך הטופס, לאחר כל הקלדה קוראים לפונ' ajaxFunction.</p>
<p>כעת נעבור לכתיבת קוד ה-AJAX. למי שלא יודע <abbr title="Asynchronous JavaScript And XML">AJAX</abbr> היא לא שפה, אלא למעשה טכניקה לשילוב של JS עם גישה לשרת (דרך פרוטוקול XMLHttpRequest). ישנם כמה דרכים למימוש הטכניקה הזו, אני בחרתי לדעתי בפשוטה מכולם והיא מימוש AJAX בשילוב עם ספריית ה-JS השימושית, jQuery.<br />
היתרון הגלום בשילוב הזה הוא כמו בכל קוד jQuery, המימוש הרבה יותר פשוט וקצר. אז בואו נעיף מבט בקוד שמתווסף לנו בין תגיות ה-Head:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:580px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js&quot;/&gt;&lt;/script&gt;<br />
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">function</span> ajaxFunction<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $.<span style="color: #660066;">ajax</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; url<span style="color: #339933;">:</span> <span style="color: #3366CC;">'heb.php?textHeb='</span><span style="color: #339933;">+</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;textarea[name=textHeb]&quot;</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><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; type<span style="color: #339933;">:</span> <span style="color: #3366CC;">'GET'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; timeout<span style="color: #339933;">:</span> 1000<span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; success<span style="color: #339933;">:</span> ...<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
<p>אם זה נראה קצת מסובך אז עוד מעט הכל יראה מאוד פשוט. נתחיל, בשורה הראשונה אנחנו מוסיפים קישור לספריית ה-jQuery. עוד לא הסברתי את זה באף מאמר כאן אבל הסיבה שאני מקשר לספריה שנמצאת בגוגל ולא מקשר לספריה שנמצאת בשרת שלי היא מכיוון ו-jQuery היא ספרייה מאוד שימושית ויש הרבה מאוד סיכוי שהגולש שנכנס לאתר שלי כבר היה באתר אחר בו השתמשו ב-jQuery (דרך גוגל) והספרייה שמורה לו במטמון. כך אני יכול לחסוך את זמן הטעינה של הספרייה.<br />
בשורה השלישית אנחנו יוצרים את הפונקציה ajaxFunction, הפונקציה שקוראים לה לאחר כל הקלדה בתיבת הטקסט שלנו.<br />
כעת אנחנו פונים למימוש של ajax ב-jQuery (שורה 4). בפנייה לאג'קס נפתחים לפנינו הרבה אופציות. אני השתמשתי כאן בארבעה משתנים:</p>
<ul>
<li>url</li>
<li>type</li>
<li>timeout</li>
<li>success</li>
</ul>
<p>המשתנה הראשון מכיל את כתובת אליה וממנה האג'קס שולח ומקבל נתונים, אנחנו נחזור אליו. המשתנה השני קובע באיזה צורה אנחנו שולחים את הנתונים (get או post). המשתנה השלישי דיי מובן משמו, משך הזמן ל-timeout (במילי שניות, 1000 = שניה אחת). במשתנה הרביעי אנחנו כותבים את הפעולות שאנחנו רוצים לבצע ברגע שהפעולה בוצעה בהצלחה.</p>
<p>בואו נחזור שנייה לתאוריה, מה שאנחנו רוצים שיקרה הוא שכאשר משתמש כותב בתיבת הטקסט שלנו, הטקסט ישלח לאחר כל הקלדה של אות לקובץ חיצוני (במקרה שלנו heb.php). קובץ זה יעבור על הטקסט שנשלח אליו, ויחליף כל תו באנגלית לתו המקביל לו (במקלדת) בעברית, ולבסוף ידפיס את המחרוזת בעברית.</p>
<p>בואו נביט שוב במשתנה ה-url (שורה 5). אנחנו בעצם פונים לקובץ ה-PHP שלנו ומעבירים לו משתנה GET בשם, textHeb. המתשנה מכיל את הערך של תיבת הטקסט שלנו. אני לא אעבור איתכם על קובץ ה-PHP (אתם מוזמנים להוריד את הקובץ ולהביט בעצמכם דרך הכפתור &quot;קוד&quot; בתחילת המדריך), אבל אני אדגיש שתי שורות חשובות מתוך הקובץ.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:580px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Cache-Control: no-cache&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-Type: text/html; charset=utf-8'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>השורה הראשונה בעצם אומרת לדפדפן לא לשמור את הדף במטמון (חשוב, על מנת שנוכל לקבל נתונים עדכניים כל הזמן). בשורה השנייה אנחנו קובעים את המסמך בקידוד utf-8 &#8211; הנקודה הזו מאוד קריטית אם אנחנו רוצים לראות עברית ולא רק קישקושים.</p>
<p>זה הכל לקובץ ה-PHP, כמו שאמרנו הקובץ מקבל מחרוזת מלאה בתווים (גם עברית גם אנגלית), כל תו אנגלי נהפך לתו המקביל-מקלדת בעברית שלו ולבסוף מוחזרת המחרוזת בעברית בלבד. כעת אנחנו צריכים לעדכן את תיבת הטקסט, הפעולה הזו מתרחשת תחת המתשנה success.</p>
<p>חזרנו לקוד ה-JS שלנו, כעת בואו נראה מה מופיע תחת המשתנה success:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:580px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">success<span style="color: #339933;">:</span> <br />
<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>text<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; textLen <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;textarea[name=textHeb]&quot;</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: #660066;">length</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>text.<span style="color: #660066;">length</span> <span style="color: #339933;">==</span> textLen<span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;textarea[name=textHeb]&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span>text<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;textarea[name=textHeb]&quot;</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: #660066;">charAt</span><span style="color: #009900;">&#40;</span>textLen<span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">' '</span> <span style="color: #339933;">&amp;&amp;</span> text.<span style="color: #660066;">length</span><span style="color: #339933;">+</span><span style="color: #CC0000;">1</span> <span style="color: #339933;">==</span> textLen<span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;textarea[name=textHeb]&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span>text<span style="color: #339933;">+</span><span style="color: #3366CC;">' '</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>בתוך המשתנה success יצרנו פונקציה עם משתנה text. המתשנה text הוא למעשה הערך שמוחזר (הודפס) בקובץ ה-PHP.<br />
למעשה יכלנו לקצר את כל הקוד ולכתוב רק:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:580px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">success<span style="color: #339933;">:</span> <br />
<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>text<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;textarea[name=textHeb]&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span>text<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>הקוד הנ&quot;ל למעשה מכניס את הערך המוחזר מקובץ ה-PHP לתוך תיבת הטקסט שלנו. הבעיה היא שאנחנו נתקלים בשני באגים. הבאג הראשון מופיע כאשר המשתמש מקליד טקסט והשרת מחזיר תגובה בזמן ההקלדה ומוחק לו את סוף המשפט שהוא כתב (פעולת המרת האנגלית בעברית לוקחת זמן ובנתיים המשתמש יכול להכניס עוד תווים). לשם כך העברתי את המחרוזת החוזרת בדיקה לראות אם אורך המחרוזת שווה לאורך תיבת הטקסט שלנו, ורק במקרה כזה יתבצע ההחלפה (שורה 4).<br />
הבאג השני הוא שכאשר התו האחרון שנשלח המחרוזת הוא סימן רווח, התו יעלם מכיוון ולא ניתן לשלוח רווחים בוסף מחרוזות. במקרה כזה אני שוב מוודא שאורך תיבת הטקסט שווה לאורך המחרוזת שחזרה מהשרת (+1) ומעדכן את תיבת הטקסט במחרוזת המוחזרת + סימן רווח.</p>
<p><ins datetime="2009-09-30T13:24:48+00:00">לסיום אני רק רוצה לציין שהמימוש כאן ב-AJAX הוא לא הכרחי ואפשר לעשות את הבדיקות וההחלפה ב-JS בלבד, הסיבה שהשתמשתי ב-AJAX היא על מנת להדגים את הטכנולוגיה ואת הפשטות של הפעלת AJAX באמצעות jQuery.</ins><br />
זה הכל, מקווה שהייתי ברור לכם, אשמח לשמוע מה אתם חושבים על הקוד וגם לענות על שאלות כאן למטה בתגובות.</p>
<h3>עוד באותו נושא:</h3><ul class="related_post"><li  class="relatedPost"><a href="http://www.htm.co.il/2009/12/15/%d7%94%d7%95%d7%a1%d7%a4%d7%aa-%d7%9b%d7%aa%d7%95%d7%91%d7%99%d7%95%d7%aa-%d7%9c%d7%aa%d7%92%d7%99%d7%aa-%d7%95%d7%99%d7%93%d7%90%d7%95/" title="<!--:il-->הוספת כתוביות לתגית וידאו<!--:--><!--:en-->Adding subtitles to a video tag<!--:-->"><img src="http://htm.co.il/wp-content/post-images/973.jpg" /><!--:il-->הוספת כתוביות לתגית וידאו<!--:--><!--:en-->Adding subtitles to a video tag<!--:--></a><div style="clear: both;"></div></li><li  class="relatedPost"><a href="http://www.htm.co.il/2009/11/15/%d7%9e%d7%a4%d7%aa-%d7%90%d7%aa%d7%a8-%d7%a6%d7%91%d7%a2%d7%95%d7%a0%d7%99%d7%aa-%d7%91%d7%a2%d7%96%d7%a8%d7%aa-jquery/" title="מפת אתר צבעונית בעזרת jQuery"><img src="http://htm.co.il/wp-content/post-images/859.jpg" />מפת אתר צבעונית בעזרת jQuery</a><div style="clear: both;"></div></li></ul></div>]]></content:encoded>			<wfw:commentRss>http://www.htm.co.il/2009/09/30/%d7%94%d7%99%d7%a4%d7%95%d7%9a-%d7%a9%d7%9c-%d7%90%d7%a0%d7%92%d7%9c%d7%99%d7%aa-%d7%9c%d7%a2%d7%91%d7%a8%d7%99%d7%aa-%d7%91%d7%90%d7%9e%d7%a6%d7%a2%d7%95%d7%aa-ajax/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>&#8235;טעינת תמונות באמצעות jQuery&#8236;</title>		<link>http://www.htm.co.il/2009/09/24/%d7%98%d7%a2%d7%99%d7%a0%d7%aa-%d7%aa%d7%9e%d7%95%d7%a0%d7%95%d7%aa-%d7%91%d7%90%d7%9e%d7%a6%d7%a2%d7%95%d7%aa-jquery/</link>
		<comments>http://www.htm.co.il/2009/09/24/%d7%98%d7%a2%d7%99%d7%a0%d7%aa-%d7%aa%d7%9e%d7%95%d7%a0%d7%95%d7%aa-%d7%91%d7%90%d7%9e%d7%a6%d7%a2%d7%95%d7%aa-jquery/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 09:46:13 +0000</pubDate>
		<dc:creator>&#8235;אורן רוט&#8236;</dc:creator>				<category><![CDATA[בניית אתרים]]></category>
		<category><![CDATA[המלצות]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[עיצוב אתרים]]></category>
		<category><![CDATA[תמונות]]></category>

		<guid isPermaLink="false">http://www.htm.co.il/?p=599</guid>
		<description><![CDATA[&#8235;טעינת תמונות גדולות יכולה לגרום ליאוש אצל מבקר באתר שלכם. באמצעות קוד jQuery פשוט תוכלו להוסיף אנימציית טעינה לתמונות ובכך לתת אינדיקציה למבקר שאכן התמונה נטענת.&#8236;]]></description>			<content:encoded><![CDATA[<div dir="rtl"><p>הצגת אנימצית טעינה בזמן טעינת תמונות הפכה לדבר מקובל, אנחנו רואים את זה בפייסבוק, באתרים עמוסים בתמונות וסתם באתרים שהחליטו להשקיע קצת יותר. האמת, זה ממש פשוט- אז למה לא? במדריך זה אני אסביר לכם איך תוכלו להציג אנימציית טעינה בזמן שהתמונות באתרכם נטענות וכאשר התמונה טעונה היא תוצג בפייד אין. בנוסף אני אצ'פר אתכם בשני לינקים לאתרים מהם תוכלו לבחור מבין מבחר עצום של אנימציות טעינה.</p>
<div id="DemoAndCodeBtns"><a href="http://htm.co.il/lab/loadImage" target="_blank" id="demoLink"><span>&lt;</span>דוגמא<span>&gt;</span></a><a href="http://htm.co.il/lab/loadImage/loadImage.rar" target="_blank"><span>&lt;</span>קוד<span>&gt;</span></a></div>
<p>אם אתם שואלים את עצמכם למה בכלל צריך את זה, התשובה היא לא צריכים. הסיבה שמשתמשים באנימציית טעינה זה על מנת לתת לגולש באתר אינדקציה שהוא מחכה למשהו שיטען ובנוסף, לדעתי, זה מוסיף נופח מקצועי לאתר שלכם.</p>
<p>ונעבור לקוד:</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:580px;height:auto;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span><br />
&nbsp; &nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp;...<br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">style</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">media</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;screen&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!--</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp;</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp;DIV#loader {</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;border: 1px solid #ccc;</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;width: 600px;</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;height: 450px;</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;overflow: hidden;</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp;}</span><br />
<br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp;DIV#loader.loading {</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;background: url(images/spinner.gif) no-repeat center center;</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp;}</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp;--&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">style</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span><br />
... &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; <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;loader&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;loading&quot;</span>&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span><br />
...<br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></div></td></tr></tbody></table></div>
<p>מה שעשיתי כאן הוא ליצור DIV עם הקלאס loading וה-ID שלו הוא loader, הוספתי קצת CSS כדיי ליפיף את הDIV אבל מה שחשוב זה שהוספתי לקלאס רקע עם תמונת הטעינה ממורכזת:</p>
<div class="codecolorer-container css default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:580px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">DIV<span style="color: #cc00cc;">#loader</span><span style="color: #6666ff;">.loading</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <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/spinner.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #993333;">center</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<p>כאשר התמונה תטען אנחנו נמחוק את הקלאס מה-DIV וכך תמונת הטעינה תעלם.</p>
<p>כעת נעבור לקוד ה-jQuery:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:580px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js&quot;/&gt;&lt;/script&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;!--</span><br />
&nbsp; &nbsp; &nbsp;$<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><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> img <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Image<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span>img<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">load</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><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<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;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#loader'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'loading'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</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><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<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;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">error</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><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// פונקציה שמטפלת במקרה בה התמונה לא יכולה לעלות</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'src'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'http://htm.co.il/lab/loadImage/images/n1366720127_335885_7404287.jpg'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//--&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
<p>בשורה הראשונה אנחנו טוענים את ספריית ה-jQuery. בשורה מס' 5 אנחנו יוצרים אלמנט של תמונה (ריק), בשורה 12 אנחנו מגדירים את מאפיין ה-src של התמונה (לינק לקובץ אותו הוא ינסה לטעון).<br />
מה שנותר לנו זה להוסיף שתי פונקציות, אחת לכאשר התמונה נטענת (שורות 6-9) ואחת לכאשר יש בעיה בטעינת התמונה (10-11).<br />
בפונקציה הראשונה, load, מה שקורה הוא שדבר ראשון מעלימים את התמונה (על מנת ליצור אפקט הופעה אח&quot;כ), מוחקים את קלאס הטעינה מה-DIV ומוסיפים ל-DIV את התמונה (שורה 8), לאחר מכן יוצרים אפקט של פייד אין לתמונה וכך התמונה מופיעה בצורה נעימה.<br />
את הפונקציה השנייה לא מימשתי אבל אתם מוזמנים לממש אותה כרצונכם.</p>
<p>וזה הקוד המלא של הדף:</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:580px;height:auto;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span><br />
&nbsp; &nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; ...<br />
&nbsp; &nbsp; &nbsp; <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><span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!--</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp;$(function () {</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp;var img = new Image();</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp;$(img).load(function () {</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$(this).hide();</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$('#loader').removeClass('loading').append(this);</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$(this).fadeIn();</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp;}).error(function () {</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// פונקציה שמטפלת במקרה בה התמונה לא יכולה לעלות</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp;}).attr('src', 'http://htm.co.il/lab/loadImage/images/n1366720127_335885_7404287.jpg');</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp;});</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp;</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp;//--&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">style</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">media</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;screen&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!--</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp;</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp;DIV#loader {</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;border: 1px solid #ccc;</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;width: 600px;</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;height: 450px;</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;overflow: hidden;</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp;}</span><br />
<br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp;DIV#loader.loading {</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;background: url(images/spinner.gif) no-repeat center center;</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp;}</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp;--&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">style</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span><br />
&nbsp; &nbsp; ...<br />
&nbsp; &nbsp; <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;loader&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;loading&quot;</span>&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span><br />
&nbsp; &nbsp; ...<br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></div></td></tr></tbody></table></div>
<p>ועכשיו כפי שהבטחתי שני אתרים להורדת אנימציית טעינה (קבצי gif):</p>
<ul>
<li>אתר <a href="http://www.ajaxload.info/" target="_blank">ajaxload</a></li>
<li>אתר <a href="http://loadinfo.net/" target="_blank">LoadInfo</a></li>
</ul>
<p>שני האתרים הללו מציעים הורדה של תמונות gif  מונפשות. אפשר להגדיר מאוד בפשטות את צבע הרקע של התמונה ואת צבע האנימציה להתאמה מושלמת לאתרכם. את התמונה הרצויה לכם תוסיפו כתמונת רקע ל-DIV הטעינה (בהגדרת הקלאס שלו).</p>
<p><script type="text/javascript">
/*var d = new Date();
var t = d.getTime();
document.getElementById('demoLink').setAttribute("href", "http://htm.co.il/lab/loadImage/index.html?date="+t);*/
</script></p>
<h3>עוד באותו נושא:</h3><ul class="related_post"><li  class="relatedPost"><a href="http://www.htm.co.il/2010/01/17/%d7%92%d7%9c%d7%a8%d7%99%d7%99%d7%aa-%d7%a4%d7%9c%d7%90%d7%a9-%d7%a2%d7%9c-%d7%91%d7%a1%d7%99%d7%a1-xml-%d7%9e%d7%aa%d7%a0%d7%94/" title="גלריית פלאש על בסיס XML מתנה!"><img src="http://htm.co.il/wp-content/post-images/988.jpg" />גלריית פלאש על בסיס XML מתנה!</a><div style="clear: both;"></div></li><li  class="relatedPost"><a href="http://www.htm.co.il/2009/12/15/%d7%94%d7%95%d7%a1%d7%a4%d7%aa-%d7%9b%d7%aa%d7%95%d7%91%d7%99%d7%95%d7%aa-%d7%9c%d7%aa%d7%92%d7%99%d7%aa-%d7%95%d7%99%d7%93%d7%90%d7%95/" title="<!--:il-->הוספת כתוביות לתגית וידאו<!--:--><!--:en-->Adding subtitles to a video tag<!--:-->"><img src="http://htm.co.il/wp-content/post-images/973.jpg" /><!--:il-->הוספת כתוביות לתגית וידאו<!--:--><!--:en-->Adding subtitles to a video tag<!--:--></a><div style="clear: both;"></div></li></ul></div>]]></content:encoded>			<wfw:commentRss>http://www.htm.co.il/2009/09/24/%d7%98%d7%a2%d7%99%d7%a0%d7%aa-%d7%aa%d7%9e%d7%95%d7%a0%d7%95%d7%aa-%d7%91%d7%90%d7%9e%d7%a6%d7%a2%d7%95%d7%aa-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8235;ולידציה נעה לשליחת טפסים&#8236;</title>		<link>http://www.htm.co.il/2009/09/22/%d7%95%d7%9c%d7%99%d7%93%d7%a6%d7%99%d7%94-%d7%a0%d7%a2%d7%94-%d7%9c%d7%a9%d7%9c%d7%99%d7%97%d7%aa-%d7%98%d7%a4%d7%a1%d7%99%d7%9d/</link>
		<comments>http://www.htm.co.il/2009/09/22/%d7%95%d7%9c%d7%99%d7%93%d7%a6%d7%99%d7%94-%d7%a0%d7%a2%d7%94-%d7%9c%d7%a9%d7%9c%d7%99%d7%97%d7%aa-%d7%98%d7%a4%d7%a1%d7%99%d7%9d/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 16:18:43 +0000</pubDate>
		<dc:creator>&#8235;אורן רוט&#8236;</dc:creator>				<category><![CDATA[בניית אתרים]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[בדיקות תקינות]]></category>
		<category><![CDATA[טפסים]]></category>

		<guid isPermaLink="false">http://www.htm.co.il/?p=502</guid>
		<description><![CDATA[&#8235;מדריך נחמד להוספת אנימציה לולדציית שליחת טפסים. הסקריפט (ב-jQuery) עובר על הטופס ומרעיד כל שדה שלא מולא ובכך מושך את עין הגולש לשדות שעליו למלא מחדש.&#8236;]]></description>			<content:encoded><![CDATA[<div dir="rtl"><p>כבר זה הרבה זמן שבשליחת טפסים (כמו ביצירת קשר, מתן פידבק&#8230;) אנחנו משתמשים בולידציה צד לקוח, שזה אומר, שלפני שאנחנו שולחים טופס מלא בנתונים אנחנו בודקים כי אכן הנתונים תואמים לדרישות השדות (איימיל יהיה מלא בכתובת מייל תיקנית, טלפון יהיה מורכב ממספרים בלבד). שדה שלא בר-תוקף (הביטוי העברי המקביל לולידציה) יסומן לרוב בצבע אדום ותופיע הודעה על מסך המשתמש שהוא אכן צריך למלא מחדש את השדה בצורה נכונה. מה שאני אסביר לכם במדריך זה הוא על אפקט פשוט ב-jQuery שיוצר אפקט תזוזה בשדות שלא מולאו נכון.</p>
<div id="DemoAndCodeBtns"><a href="http://htm.co.il/lab/moveVaildator" target="_blank"><span>&lt;</span>דוגמא<span>&gt;</span></a><a href="http://htm.co.il/lab/moveVaildator/moveVaildator.rar" target="_blank"><span>&lt;</span>קוד<span>&gt;</span></a></div>
<p>את הרעיון למדריך הזה לקחתי מהאתר המומלץ (<a href="http://www.jankoatwarpspeed.com/post/2009/09/16/Animate-validation-feedback-using-jQuery.aspx" target="_blank">janko at warp speed</a>) והדוגמא שאני אתן לכם פה היא למעשה מאוד פשוטה. נעשית בדיקה פשוטה ב-jQuery, אם אחד מהשדות הקיימים ריק ואם כן נוצרת אנימציה על אותה שדה והוא נצבע באדום. זוהי הבדיקה:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:580px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<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><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#signup&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</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><br />
&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> emptyfields <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input[value=]&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>emptyfields.<span style="color: #660066;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> 0<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;emptyfields.<span style="color: #660066;">each</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><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//האנימציה מתרחשת כאן</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp;<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>מה שבעצם קורה כאן, כאשר לוחצים על כפתור השליחה הסקריפט עובר על כל השדות (input) הריקים, אם יש לפחות שדה אחד, הוא מבצע עליו אנימציה.</p>
<h3>האנימציה</h3>
<p>בואו נסתכל על הקוד לאחר הוספת האנימציה:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:580px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<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><br />
&nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#signup&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</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><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> emptyfields <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input[value=]&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>emptyfields.<span style="color: #660066;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> 0<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; emptyfields.<span style="color: #660066;">each</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><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; .<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> left<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;-10px&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> left<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;10px&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; .<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> left<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;-10px&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> left<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;10px&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; .<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> left<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;0px&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; .<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;required&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>האנימציה שהסקריפט מבצע הוא למעשה הזזה שמאלה וימינה של השדה הריק והוספת class שצובע את השדה בצבע אדום.</p>
<div class="warning">שימו לב! על-מנת שהסקריפט יעבוד חייבים להגדיר position:relative לכל השדות הנעים (input)</div>
<p>אנחנו ממש קרובים לסיום, הדבר היחידי  שחסר לנו הוא הסרת הצבע האדום כאשר השדה הופך להיות בר תוקף.</p>
<p>כל שאנחנו צריכים להוסיף לסקריפט את השורות הבאות:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:580px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<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><br />
&nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#signup&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</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><br />
&nbsp; &nbsp; &nbsp;resetFields<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> emptyfields <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input[value=]&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>emptyfields.<span style="color: #660066;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> 0<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; emptyfields.<span style="color: #660066;">each</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><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; .<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> left<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;-10px&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> left<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;10px&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; .<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> left<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;-10px&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> left<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;10px&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; .<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> left<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;0px&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; .<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;required&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #003366; font-weight: bold;">function</span> resetFields<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input[type=text], input[type=password]&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;required&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>מה שעשינו הוא הוספנו בתחילת הסקריפט קריאה לפונקציה resetFields וכמובן הוספנו את הפונקציה עצמה אשר מוחקת מכל שדות הinput את מאפיין ה-class.</p>
<p>כעת סיימנו. כמובן שהטופס הזה לא שולח שוב דבר, מה שהראתי לכם פה זה איך לבצע אנימציה חמודה על-מנת להראות לגולש בביוור אילו שדות הוא לא מילא כראוי (לא בדקנו שאימייל הוא אימייל תקין או ששדה וידוא סיסמא באמת מכיל את הסיסמא), אתם מוזמנים לשלב את הקוד שהוצג פה יחד עם ה<a href="http://www.internet-israel.com/internet/%D7%91%D7%A0%D7%99%D7%99%D7%AA-%D7%90%D7%AA%D7%A8%D7%99%D7%9D/jquery-scripts-%D7%A2%D7%91%D7%95%D7%A8-%D7%91%D7%95%D7%A0%D7%99-%D7%90%D7%AA%D7%A8%D7%99-%D7%90%D7%99%D7%A0%D7%98%D7%A8%D7%A0%D7%98/%D7%9E%D7%93%D7%A8%D7%99%D7%9A-%D7%99%D7%A6%D7%99%D7%A8%D7%AA-%D7%98%D7%95%D7%A4%D7%A1-%D7%A6%D7%95%D7%A8-%D7%A7%D7%A9%D7%A8-%D7%91-ajax-%D7%A2%D7%9D-jquery/" target="_blank">מדריך המעולה של אינטרנט ישראל ליצירת ולדציה לטפסים</a> ובכך ליצור טופס עם ולדציה מלאה ואנימציה מבהירה.</p>
<p>בהצלחה!</p>
<h3>עוד באותו נושא:</h3><ul class="related_post"><li  class="relatedPost"><a href="http://www.htm.co.il/2009/10/22/%d7%94%d7%a4%d7%99%d7%9b%d7%aa-%d7%98%d7%95%d7%a4%d7%a1-%d7%9c%d7%aa%d7%94%d7%9c%d7%99%d7%9a-%d7%94%d7%a8%d7%a9%d7%9e%d7%94/" title="הפיכת טופס לתהליך הרשמה"><img src="http://htm.co.il/wp-content/post-images/714.jpg" />הפיכת טופס לתהליך הרשמה</a><div style="clear: both;"></div></li><li  class="relatedPost"><a href="http://www.htm.co.il/2009/12/15/%d7%94%d7%95%d7%a1%d7%a4%d7%aa-%d7%9b%d7%aa%d7%95%d7%91%d7%99%d7%95%d7%aa-%d7%9c%d7%aa%d7%92%d7%99%d7%aa-%d7%95%d7%99%d7%93%d7%90%d7%95/" title="<!--:il-->הוספת כתוביות לתגית וידאו<!--:--><!--:en-->Adding subtitles to a video tag<!--:-->"><img src="http://htm.co.il/wp-content/post-images/973.jpg" /><!--:il-->הוספת כתוביות לתגית וידאו<!--:--><!--:en-->Adding subtitles to a video tag<!--:--></a><div style="clear: both;"></div></li></ul></div>]]></content:encoded>			<wfw:commentRss>http://www.htm.co.il/2009/09/22/%d7%95%d7%9c%d7%99%d7%93%d7%a6%d7%99%d7%94-%d7%a0%d7%a2%d7%94-%d7%9c%d7%a9%d7%9c%d7%99%d7%97%d7%aa-%d7%98%d7%a4%d7%a1%d7%99%d7%9d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>



