<?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>mysrc.de &#187; Best Practice</title> <atom:link href="http://www.mysrc.de/tag/best-practice/feed/" rel="self" type="application/rss+xml" /><link>http://www.mysrc.de</link> <description>- jQuery, MooTools, HTML5, AJAX</description> <lastBuildDate>Tue, 14 Jun 2011 08:24:25 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <item><title>MooTools MenuMatic &#8211; Firefox 4 zweizeilig Problem</title><link>http://www.mysrc.de/mootools/mootools-menumatic-firefox-4-zweizeilig-problem/</link> <comments>http://www.mysrc.de/mootools/mootools-menumatic-firefox-4-zweizeilig-problem/#comments</comments> <pubDate>Thu, 24 Mar 2011 10:20:00 +0000</pubDate> <dc:creator>Oliver Storm</dc:creator> <category><![CDATA[MooTools]]></category> <category><![CDATA[Best Practice]]></category> <category><![CDATA[bug]]></category> <category><![CDATA[Tipp!]]></category> <guid
isPermaLink="false">http://www.mysrc.de/?p=1173</guid> <description><![CDATA[Die Zeit der neuen Browser. Und auch wenn alles schön und neu ist, heute morgen hatte ich dann auch gleich das erste kleine Problem. Firefox4 mit MenuMatic wollten nicht ganz so wie ich. In meiner Navigation wurd ein Punkt zweizeilig und somit die ganze Höhe meines Menüs falsch, was zur Folge hatte das unten ein [...]]]></description> <content:encoded><![CDATA[<p>Die Zeit der neuen Browser. Und auch wenn alles schön und neu ist, heute morgen hatte ich dann auch gleich das erste kleine Problem.</p><p>Firefox4 mit <a
title="MenuMatic" href="http://greengeckodesign.com/taxonomy/term/3/0?page=3" target="_blank">MenuMatic</a> wollten nicht ganz so wie ich. In meiner Navigation wurd ein Punkt zweizeilig und somit die ganze Höhe meines Menüs falsch, was zur Folge hatte das unten ein Stück abgeschnitten wurde.</p><p>Da sich über CSS keine Lösung finden ließ habe ich die js-Datei (MenuMatic_0.68.3-source.js) wie folgt geändert:<br
/> <strong>Zeile 737 </strong>einfach um <strong>+2</strong> erhöht.</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p1173code2'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p11732"><td
class="line_numbers"><pre>1
</pre></td><td
class="code" id="p1173code2"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">width</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">childMenu</span>.<span style="color: #660066;">getFirst</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getCoordinates</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #339933;">+</span><span style="color: #CC0000;">2</span><span style="color: #339933;">;</span></pre></td></tr></table></div><p>Ich hoffe das hilft dem ein oder anderen weiter&#8230;</p><h3  class="related_post_title">Ähnliche Artikel</h3><ul
class="related_post"><li>17. September 2009 -- <a
href="http://www.mysrc.de/mootools/praxistipp-position-absolute-parent-height-anpassen-mit-mootools/" title="Praxistipp &#8211; position absolute &#8211; parent height anpassen mit MooTools ">Praxistipp &#8211; position absolute &#8211; parent height anpassen mit MooTools </a></li><li>23. März 2010 -- <a
href="http://www.mysrc.de/jquery/praxistipp-%e2%80%93-jqtransform-bug-bei-input-in-firefox-3-5-2/" title="Praxistipp – jqTransform Bug bei input in Firefox > 3.5.2">Praxistipp – jqTransform Bug bei input in Firefox > 3.5.2</a></li><li>16. Oktober 2009 -- <a
href="http://www.mysrc.de/jquery/praxistipp-jqtransform-width-bug/" title="Praxistipp &#8211; jqTransform width bug">Praxistipp &#8211; jqTransform width bug</a></li></ul>]]></content:encoded> <wfw:commentRss>http://www.mysrc.de/mootools/mootools-menumatic-firefox-4-zweizeilig-problem/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Praxistipp: Suchfeld leeren on focus (jQuery)</title><link>http://www.mysrc.de/jquery/praxistipp-suchfeld-leeren-on-focus-jquery/</link> <comments>http://www.mysrc.de/jquery/praxistipp-suchfeld-leeren-on-focus-jquery/#comments</comments> <pubDate>Fri, 19 Nov 2010 12:52:24 +0000</pubDate> <dc:creator>Oliver Storm</dc:creator> <category><![CDATA[jQuery]]></category> <category><![CDATA[Best Practice]]></category> <category><![CDATA[Forms]]></category> <category><![CDATA[Formulare]]></category> <category><![CDATA[Suche]]></category> <guid
isPermaLink="false">http://www.mysrc.de/?p=1139</guid> <description><![CDATA[Gestern hatte ich wieder diesen Fall&#8230;. Man hat´s schon x-mal gemacht, aber immer wenn man es wieder braucht findet man das code-schnippselchen nicht. Ich wollte heute in einem Projekt einfach nur das Suchfeld, welches default als Wert &#8220;Suche&#8221; drin stehen hat, auf klick ins Feld leeren und, sollte der User nichts anderes eingegeben haben beim [...]]]></description> <content:encoded><![CDATA[<p>Gestern hatte ich wieder diesen Fall&#8230;.<br
/> Man hat´s schon x-mal gemacht, aber immer wenn man es wieder braucht findet man das code-schnippselchen nicht.</p><p>Ich wollte heute in einem Projekt einfach nur das <strong>Suchfeld</strong>, welches default als Wert &#8220;Suche&#8221; drin stehen hat, auf klick ins Feld <strong>leeren </strong>und, sollte der User nichts anderes eingegeben haben beim Verlassen das Feld wieder mit diesem Standardwert füllen.</p><p>Hier der Code:</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p1139code4'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p11394"><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td
class="code" id="p1139code4"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.search'</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">focus</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>
	value<span style="color: #339933;">=</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;value&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.search'</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">blur</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span>value<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><p>Ich hoffe das hilft dem ein oder anderen&#8230;</p><h3  class="related_post_title">Ähnliche Artikel</h3><ul
class="related_post"><li>23. März 2010 -- <a
href="http://www.mysrc.de/jquery/praxistipp-%e2%80%93-jqtransform-bug-bei-input-in-firefox-3-5-2/" title="Praxistipp – jqTransform Bug bei input in Firefox > 3.5.2">Praxistipp – jqTransform Bug bei input in Firefox > 3.5.2</a></li><li>16. Oktober 2009 -- <a
href="http://www.mysrc.de/jquery/jquery-accessible-ria-widgets-fur-jedermann/" title="jQuery &#8211; Accessible-RIA &#8211; Widgets für jedermann">jQuery &#8211; Accessible-RIA &#8211; Widgets für jedermann</a></li><li>17. September 2009 -- <a
href="http://www.mysrc.de/jquery/jcryption-html-form-encryption-plugin/" title="jCryption &#8211; HTML-Form Encryption Plugin">jCryption &#8211; HTML-Form Encryption Plugin</a></li></ul>]]></content:encoded> <wfw:commentRss>http://www.mysrc.de/jquery/praxistipp-suchfeld-leeren-on-focus-jquery/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Praxistipp – jqTransform Bug bei input in Firefox &gt; 3.5.2</title><link>http://www.mysrc.de/jquery/praxistipp-%e2%80%93-jqtransform-bug-bei-input-in-firefox-3-5-2/</link> <comments>http://www.mysrc.de/jquery/praxistipp-%e2%80%93-jqtransform-bug-bei-input-in-firefox-3-5-2/#comments</comments> <pubDate>Tue, 23 Mar 2010 13:16:37 +0000</pubDate> <dc:creator>Oliver Storm</dc:creator> <category><![CDATA[jQuery]]></category> <category><![CDATA[Best Practice]]></category> <category><![CDATA[bug]]></category> <category><![CDATA[Formulare]]></category> <category><![CDATA[Plugin]]></category> <guid
isPermaLink="false">http://www.mysrc.de/?p=1072</guid> <description><![CDATA[Wer von euch jqTransform nutzt wird evtl. nach dem letzten Firefox Update festegestellt haben das der Text in den Inputs nicht mehr sauber mittig sitzt. Gilt für Firefox ab 3.5.2. Das ganze liegt an der neuen Render Engine die Firefox spendiert bekommen hat. Um das Problem in den Griff zu bekommen, ohne sideeffects für andere [...]]]></description> <content:encoded><![CDATA[<p>Wer von euch<strong> jqTransform</strong> nutzt wird evtl. nach dem letzten Firefox Update festegestellt haben das der Text in den <strong>Inputs</strong> nicht mehr sauber mittig sitzt.<br
/> Gilt für Firefox ab 3.5.2.</p><p><a
href="http://www.mysrc.de/wp-content/uploads/2010/03/jqtransform-input-bug.png"><img
class="alignnone size-full wp-image-1074" title="jqtransform input bug" src="http://www.mysrc.de/wp-content/uploads/2010/03/jqtransform-input-bug.png" alt="jqTransform bug im Firefox" width="241" height="37" /></a></p><p>Das ganze liegt an der neuen Render Engine die Firefox spendiert bekommen hat.<br
/> Um das Problem in den Griff zu bekommen, ohne sideeffects für andere Browser zu bekommen macht Ihr einfach folgendes.</p><p>Eure jqtransform.css auf, in Zeile 90 (.jqTransformInputInner div input {) änder Ihr die <strong>height jetzt von 31px auf auto</strong>.</p><p>Das war´s schon&#8230;.</p><h3  class="related_post_title">Ähnliche Artikel</h3><ul
class="related_post"><li>24. Juni 2009 -- <a
href="http://www.mysrc.de/jquery/ifixpng2-pngfix-transparenz-fur-den-ie6/" title="ifixpng2 &#038; pngFix &#8211; Transparenz für den IE6">ifixpng2 &#038; pngFix &#8211; Transparenz für den IE6</a></li><li>19. November 2010 -- <a
href="http://www.mysrc.de/jquery/praxistipp-suchfeld-leeren-on-focus-jquery/" title="Praxistipp: Suchfeld leeren on focus (jQuery)">Praxistipp: Suchfeld leeren on focus (jQuery)</a></li><li>16. Oktober 2009 -- <a
href="http://www.mysrc.de/jquery/praxistipp-jqtransform-width-bug/" title="Praxistipp &#8211; jqTransform width bug">Praxistipp &#8211; jqTransform width bug</a></li></ul>]]></content:encoded> <wfw:commentRss>http://www.mysrc.de/jquery/praxistipp-%e2%80%93-jqtransform-bug-bei-input-in-firefox-3-5-2/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>jQuery &#8211; Click Handler Elementen zuordnen und entfernen</title><link>http://www.mysrc.de/jquery/jquery-click-handler-elementen-zuordnen-und-entfernen/</link> <comments>http://www.mysrc.de/jquery/jquery-click-handler-elementen-zuordnen-und-entfernen/#comments</comments> <pubDate>Thu, 03 Dec 2009 10:43:04 +0000</pubDate> <dc:creator>Oliver Storm</dc:creator> <category><![CDATA[jQuery]]></category> <category><![CDATA[Best Practice]]></category> <category><![CDATA[click handler]]></category> <guid
isPermaLink="false">http://www.mysrc.de/?p=1046</guid> <description><![CDATA[Click handler sind wohl eine der meistgenutzen Funktionen wenn man mit jQuery arbeitet. Selten kommt man ohne sie aus. Ich will euch heute mal kurz ein paar Feinheiten hierzu vorstellen. Einen Click handler einem Element hinzufügen Einem Element einen Click handler mitzugeben ist wohl mit das einfachste. ?View Code JAVASCRIPT1 2 3 $&#40;'#idDesElements'&#41;.click&#40;function&#40;&#41;&#123;     window.alert&#40;&#34;Click [...]]]></description> <content:encoded><![CDATA[<p><a
title="jQuery - Events - click" href="http://docs.jquery.com/Events/click" target="_blank">Click handler</a> sind wohl eine der meistgenutzen Funktionen wenn man mit jQuery arbeitet. Selten kommt man ohne sie aus.<br
/> Ich will euch heute mal kurz ein paar Feinheiten hierzu vorstellen.</p><p><strong>Einen Click handler einem Element hinzufügen</strong><br
/> Einem Element einen Click handler mitzugeben ist wohl mit das einfachste.</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p1046code10'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p104610"><td
class="line_numbers"><pre>1
2
3
</pre></td><td
class="code" id="p1046code10"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#idDesElements'</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>
    window.<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Click handler ausgelöst!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><p><strong>Mehrer Click handler einem Element hinzufügen</strong><br
/> Einem Element kann übrigens mehr als nur ein Click handler zugewiesen werden.<br
/> Wird das Element geklickt, werden alle handler der Reihe nach ausgeführt.</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p1046code11'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p104611"><td
class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td
class="code" id="p1046code11"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#idDesElements'</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>
    window.<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Click handler 1!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#idDesElements'</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>
    window.<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Click handler 2&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><p><strong>Click Handler entfernen</strong><br
/> Um Click Handler wieder zu entfernen reicht ein einfaches unbind.</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p1046code12'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p104612"><td
class="line_numbers"><pre>1
</pre></td><td
class="code" id="p1046code12"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#idDesElements'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">unbind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><p><strong>Click Handler hinzufügen und gleichzeitig entfernen</strong><br
/> Da wir mit jQuery ja die wunderschöne Methode des Chainings zur verfügung haben, können wir einem einem Element alle Ihm bisher zugeordneten Click Handler entziehen und gleichzeitig einen neuen hinzufügen.</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p1046code13'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p104613"><td
class="line_numbers"><pre>1
2
3
</pre></td><td
class="code" id="p1046code13"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#idDesElements'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">unbind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</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>
    window.<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;neuer Click handler ausgelöst!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><p><strong>Click Handler und Anker</strong><br
/> Wenn man einen Click Handler an einen Linkanker aufruft, aber nicht will das der Browser dem Link folgt, nachdem der Handler aufgerufen wird muss zusätzlich einfach ein return false;</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p1046code14'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p104614"><td
class="line_numbers"><pre>1
2
3
4
</pre></td><td
class="code" id="p1046code14"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#idDesElements'</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>
    window.<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Click handler&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><h3  class="related_post_title">Ähnliche Artikel</h3><ul
class="related_post"><li>19. November 2010 -- <a
href="http://www.mysrc.de/jquery/praxistipp-suchfeld-leeren-on-focus-jquery/" title="Praxistipp: Suchfeld leeren on focus (jQuery)">Praxistipp: Suchfeld leeren on focus (jQuery)</a></li><li>23. März 2010 -- <a
href="http://www.mysrc.de/jquery/praxistipp-%e2%80%93-jqtransform-bug-bei-input-in-firefox-3-5-2/" title="Praxistipp – jqTransform Bug bei input in Firefox > 3.5.2">Praxistipp – jqTransform Bug bei input in Firefox > 3.5.2</a></li><li>26. November 2009 -- <a
href="http://www.mysrc.de/allgemein/jquery-howto-traversing/" title="jQuery HowTo: Traversing">jQuery HowTo: Traversing</a></li></ul>]]></content:encoded> <wfw:commentRss>http://www.mysrc.de/jquery/jquery-click-handler-elementen-zuordnen-und-entfernen/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>jQuery HowTo: Traversing</title><link>http://www.mysrc.de/allgemein/jquery-howto-traversing/</link> <comments>http://www.mysrc.de/allgemein/jquery-howto-traversing/#comments</comments> <pubDate>Thu, 26 Nov 2009 15:28:20 +0000</pubDate> <dc:creator>Stefan Huissel</dc:creator> <category><![CDATA[Allgemein]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[Best Practice]]></category> <category><![CDATA[Selektoren]]></category> <guid
isPermaLink="false">http://www.mysrc.de/?p=969</guid> <description><![CDATA[Travesieren gehört zum grundlegenden Handwerkszeug, wenn man fortgeschrittene Animationen mittels jQuery durchführen möchte. Hier ein kleine Anleitung zum Auffinden bestimmter Elemente. Parent &#160;&#187;Child1 &#160;&#187;Child2 &#160;&#187;Child3 &#160;&#187;Child4 Move all Move filtered Set back Was passiert hier? Basis ist diese HTML Struktur: ?View Code HTML1 2 3 4 5 6 7 8 9 10 11 12 13 [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://de.wikipedia.org/wiki/Traversierung" target="blank">Travesieren</a> gehört zum grundlegenden Handwerkszeug, wenn man fortgeschrittene Animationen mittels jQuery durchführen möchte. Hier ein kleine Anleitung zum Auffinden bestimmter Elemente.</p><div
style="border: 1px dotted #ccc">Parent</p><div> &nbsp;&raquo;Child1</div><div
class="move"> &nbsp;&raquo;Child2</div><div> &nbsp;&raquo;Child3</div><div
class="move not"> &nbsp;&raquo;Child4</div></div><div
id="someWrapper"> <a
id="testone" href="#">Move all</a><br
/> <a
id="testtwo" href="#">Move filtered</a><br/><br
/> <a
id="setBack" href="#">Set back</a></div><p>Was passiert hier? Basis ist diese HTML Struktur:</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p969code18'); return false;">View Code</a> HTML</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p96918"><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td
class="code" id="p969code18"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;someParent&quot; style=&quot;border: 1px dotted #ccc&quot;&gt;Parent
&lt;div&gt;
 Child1
&lt;/div&gt;
&lt;div class=&quot;move&quot;&gt;
 Child2
&lt;/div&gt;
&lt;div&gt;
 Child3
&lt;/div&gt;
&lt;div class=&quot;move not&quot;&gt;
 Child4
&lt;/div&gt;
&lt;/div&gt;
&nbsp;
&lt;div id=&quot;someWrapper&quot;&gt;
&lt;a  id=&quot;testone&quot; href=&quot;#&quot;&gt;Move all&lt;/a&gt;
&lt;a id=&quot;testtwo&quot; href=&quot;#&quot;&gt;Move filtered&lt;/a&gt;
&lt;/div&gt;</pre></td></tr></table></div><p>Folgender Javascript-Code führt die Animation aus. Ausgehend von dem Link wird mit den Methoden <strong>parent</strong> das div &#8220;someWrapper&#8221; selektiert, <strong>prev</strong> wählt das vorige Element mit der id &#8220;someParent&#8221; und schlussendlich werden mit <strong>children</strong> alle Elemente innerhalb von &#8220;someParent&#8221; selektiert.<br
/> Die id&#8217;s im Beispiel dienen nur der Veranschaulichung. Die zu animierenden Elemente werden ausschließlich über die Struktur des <a
href="http://de.wikipedia.org/wiki/Document_Object_Model" target="blank">DOM</a> gefunden.</p><p><script type="text/javascript">jQuery("#testone").click(function (e) {
    jQuery(this).parent().prev().children().animate({'paddingLeft':'20px'},200);
     return false;
});
jQuery("#testtwo").click(function (e) {
   jQuery(this).parent().prev().children().filter(".move").not(".not").animate({'paddingLeft':'20px'},200);
    return false;
});
jQuery("#setBack").click(function (e) {
   jQuery(this).parent().prev().children().animate({'paddingLeft':0},200);
    return false;
});</script></p><p>jQuery Code für &#8220;Move all&#8221;:</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p969code19'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p96919"><td
class="line_numbers"><pre>1
2
3
4
</pre></td><td
class="code" id="p969code19"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#testone&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>
    jQuery<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;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">prev</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</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><span style="color: #3366CC;">'paddingLeft'</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'20px'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #CC0000;">200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><p>Nun zur fortgeschrittenen Variante. Basis dafür sind die jQuery Funktion, <strong>filter</strong> und <strong>not</strong>.<br
/> jQuery Code für &#8220;Move filtered&#8221;:</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p969code20'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p96920"><td
class="line_numbers"><pre>1
2
3
4
</pre></td><td
class="code" id="p969code20"><pre class="javascript" style="font-family:monospace;">jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#testtwo&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>
   jQuery<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;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">prev</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">filter</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.move&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">not</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.not&quot;</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><span style="color: #3366CC;">'paddingLeft'</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'20px'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #CC0000;">200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><h3  class="related_post_title">Ähnliche Artikel</h3><ul
class="related_post"><li>19. November 2010 -- <a
href="http://www.mysrc.de/jquery/praxistipp-suchfeld-leeren-on-focus-jquery/" title="Praxistipp: Suchfeld leeren on focus (jQuery)">Praxistipp: Suchfeld leeren on focus (jQuery)</a></li><li>14. November 2010 -- <a
href="http://www.mysrc.de/jquery/fadetoggle-die-neue-in-jquery-1-4-4/" title="fadeToggle &#8211; die Neue in jQuery 1.4.4">fadeToggle &#8211; die Neue in jQuery 1.4.4</a></li><li>23. März 2010 -- <a
href="http://www.mysrc.de/jquery/praxistipp-%e2%80%93-jqtransform-bug-bei-input-in-firefox-3-5-2/" title="Praxistipp – jqTransform Bug bei input in Firefox > 3.5.2">Praxistipp – jqTransform Bug bei input in Firefox > 3.5.2</a></li></ul>]]></content:encoded> <wfw:commentRss>http://www.mysrc.de/allgemein/jquery-howto-traversing/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Praxistipp &#8211; jqTransform width bug</title><link>http://www.mysrc.de/jquery/praxistipp-jqtransform-width-bug/</link> <comments>http://www.mysrc.de/jquery/praxistipp-jqtransform-width-bug/#comments</comments> <pubDate>Fri, 16 Oct 2009 12:58:02 +0000</pubDate> <dc:creator>Stefan Huissel</dc:creator> <category><![CDATA[jQuery]]></category> <category><![CDATA[Best Practice]]></category> <category><![CDATA[Plugin]]></category> <category><![CDATA[Tipp!]]></category> <guid
isPermaLink="false">http://www.mysrc.de/?p=890</guid> <description><![CDATA[Wer jqTransform schon einmal benutzt hat wird sicherlich festgestellt haben, dass der Internet Explorer und der Firefox Browser die Textfelder in einer unterschiedlichen Breite darstellen. Das ist zurückzuführen auf das size-Attribut, dass selbst wenn nicht im input Feld verankert im IE mitberücksichtigt wird. Ein kleiner Workaround dafür ist, die Berechnung des Size-Attributs im js-Code zu [...]]]></description> <content:encoded><![CDATA[<p>Wer <a
href="http://www.dfc-e.com/metiers/multimedia/opensource/jqtransform/">jqTransform</a> schon einmal benutzt hat wird sicherlich festgestellt haben, dass der Internet Explorer und der Firefox Browser die<strong> Textfelder in einer unterschiedlichen Breite</strong> darstellen.<br
/> Das ist zurückzuführen auf das size-Attribut, dass selbst wenn nicht im input Feld verankert im IE mitberücksichtigt wird.</p><p>Ein kleiner <strong>Workaround </strong>dafür ist, die Berechnung des Size-Attributs im js-Code zu entfernen. Selbstverständlich mit der Folge, dass dieses Attribut <strong>nicht mehr zu diesem Zweck eingesetzt werden kann</strong>. Was ich persönlich als nicht weiter schlimm erachte, da zur Best Practice des Webprogrammieres gehört, die Festlegung von Oberflächeneigenschaften über das CSS zu definieren.</p><p>Nun zum Workaround:</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p890code22'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p89022"><td
class="line_numbers"><pre>1
2
3
4
5
</pre></td><td
class="code" id="p890code22"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// Z. 107 in der jquery.transform.js</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$input.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'size'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		inputSize <span style="color: #339933;">=</span> $input.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'size'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #CC0000;">10</span><span style="color: #339933;">;</span>
		$input.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'width'</span><span style="color: #339933;">,</span>inputSize<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></td></tr></table></div><p>Diesen Codeteil könnt ihr einfach löschen, da es zur falschen Berechnung der Breite für die Textfelder führt. Ich konnte keine ungewollten Seiteneffekte feststellen. Wenn ihr etwas findet, wäre ich dankbar für Kommentare.</p><h3  class="related_post_title">Ähnliche Artikel</h3><ul
class="related_post"><li>5. August 2009 -- <a
href="http://www.mysrc.de/jquery/tipp-highlighten-eins-li%c2%b4s-innerhalb-einer-list-mit-jquery/" title="Tipp! &#8211; Highlighten eins li´s innerhalb einer Liste mit jQuery">Tipp! &#8211; Highlighten eins li´s innerhalb einer Liste mit jQuery</a></li><li>23. März 2010 -- <a
href="http://www.mysrc.de/jquery/praxistipp-%e2%80%93-jqtransform-bug-bei-input-in-firefox-3-5-2/" title="Praxistipp – jqTransform Bug bei input in Firefox > 3.5.2">Praxistipp – jqTransform Bug bei input in Firefox > 3.5.2</a></li><li>20. Oktober 2009 -- <a
href="http://www.mysrc.de/jquery/praxistipp-jqtransform-button-width-einstellen/" title="Praxistipp: jqTransform Button width einstellen">Praxistipp: jqTransform Button width einstellen</a></li></ul>]]></content:encoded> <wfw:commentRss>http://www.mysrc.de/jquery/praxistipp-jqtransform-width-bug/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>jQuery &#8211; Accessible-RIA &#8211; Widgets für jedermann</title><link>http://www.mysrc.de/jquery/jquery-accessible-ria-widgets-fur-jedermann/</link> <comments>http://www.mysrc.de/jquery/jquery-accessible-ria-widgets-fur-jedermann/#comments</comments> <pubDate>Fri, 16 Oct 2009 08:08:05 +0000</pubDate> <dc:creator>Oliver Storm</dc:creator> <category><![CDATA[jQuery]]></category> <category><![CDATA[Best Practice]]></category> <category><![CDATA[Formulare]]></category> <category><![CDATA[jQuery UI]]></category> <category><![CDATA[Lightbox]]></category> <category><![CDATA[usability]]></category> <guid
isPermaLink="false">http://www.mysrc.de/?p=887</guid> <description><![CDATA[Heute morgen bin ich auf was nettes gestoßen das ich hier kurz erwähnen möchte. jQuery &#8211; Accessible-RIA ist eine Sammlung von mehreren einfach zu implementierenden Widgets, welche alle 100% WAI WCAG 2.0 und WAI AIRA konform sind. Besonders für Frontend Entwickler ist das ganze interessant. Macht es eine Seite doch für jedermann vollständig zugänglich. Das [...]]]></description> <content:encoded><![CDATA[<p><img
class="alignnone size-full wp-image-888" title="jquery-accessible-ria" src="http://www.mysrc.de/wp-content/uploads/2009/10/jquery-accessible-ria.jpg" alt="jquery-accessible-ria" width="480" height="225" /><br
/> Heute morgen bin ich auf was nettes gestoßen das ich hier kurz erwähnen möchte.<br
/> <a
title="jQuery - Accessible-RIA" href="http://wiki.github.com/fnagel/jQuery-Accessible-RIA" target="_blank">jQuery &#8211; Accessible-RIA </a>ist eine Sammlung von mehreren einfach zu implementierenden Widgets, welche alle 100% WAI WCAG 2.0 und WAI AIRA konform sind.<br
/> Besonders für Frontend Entwickler ist das ganze interessant. Macht es eine Seite doch für jedermann vollständig zugänglich.</p><p>Das ganze basiert auf jQuery UI und beinhaltete folgende Widgets:</p><ul><li><a
href="http://wiki.github.com/fnagel/jQuery-Accessible-RIA/lightbox">Lightbox</a> (<a
href="http://fnagel.github.com/jQuery-Accessible-RIA/Lightbox/">Demo</a>)</li><li><a
href="http://wiki.github.com/fnagel/jQuery-Accessible-RIA/formular">Formular</a> (<a
href="http://fnagel.github.com/jQuery-Accessible-RIA/Formular/">Demo</a>)</li><li><a
href="http://wiki.github.com/fnagel/jQuery-Accessible-RIA/tabs">Tabs</a> (<a
href="http://fnagel.github.com/jQuery-Accessible-RIA/Tabs/">Demo</a>)</li><li><a
href="http://wiki.github.com/fnagel/jQuery-Accessible-RIA/table">sortierbare Tabellen</a> (<a
href="http://fnagel.github.com/jQuery-Accessible-RIA/Table/">Demo</a>)</li></ul><p>Alle Infos zum Projekt, sowie Demos, Doku usw findet man im <a
title="jQuery - Accessible-RIA" href="http://wiki.github.com/fnagel/jQuery-Accessible-RIA" target="_blank">Wiki von github</a>.</p><h3  class="related_post_title">Ähnliche Artikel</h3><ul
class="related_post"><li>19. November 2010 -- <a
href="http://www.mysrc.de/jquery/praxistipp-suchfeld-leeren-on-focus-jquery/" title="Praxistipp: Suchfeld leeren on focus (jQuery)">Praxistipp: Suchfeld leeren on focus (jQuery)</a></li><li>23. März 2010 -- <a
href="http://www.mysrc.de/jquery/praxistipp-%e2%80%93-jqtransform-bug-bei-input-in-firefox-3-5-2/" title="Praxistipp – jqTransform Bug bei input in Firefox > 3.5.2">Praxistipp – jqTransform Bug bei input in Firefox > 3.5.2</a></li><li>12. Juni 2009 -- <a
href="http://www.mysrc.de/jquery/bessere-textfelder-prettycomments-jquery-plugin/" title="Bessere Textfelder &#8211; prettyComments jQuery Plugin">Bessere Textfelder &#8211; prettyComments jQuery Plugin</a></li></ul>]]></content:encoded> <wfw:commentRss>http://www.mysrc.de/jquery/jquery-accessible-ria-widgets-fur-jedermann/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Praxistipp &#8211; position absolute &#8211; parent height anpassen mit MooTools</title><link>http://www.mysrc.de/mootools/praxistipp-position-absolute-parent-height-anpassen-mit-mootools/</link> <comments>http://www.mysrc.de/mootools/praxistipp-position-absolute-parent-height-anpassen-mit-mootools/#comments</comments> <pubDate>Thu, 17 Sep 2009 08:59:36 +0000</pubDate> <dc:creator>Oliver Storm</dc:creator> <category><![CDATA[MooTools]]></category> <category><![CDATA[Best Practice]]></category> <category><![CDATA[Tipp!]]></category> <guid
isPermaLink="false">http://www.mysrc.de/?p=883</guid> <description><![CDATA[Gestern bin ich auf ein kleines Problem mit einem absolut positionierten Div gestoßen. Ich musste ein Div absolut positionieren doch sein parent Container sollte die Höhe entsprechend anpassen. Da man ja mit absolute das Div aus dem Dokumentenfluß reißt geht das mit herkömmlichem CSS leider nicht. Da für die Seite MooTools im Einsatz ist hab [...]]]></description> <content:encoded><![CDATA[<p>Gestern bin ich auf ein kleines Problem mit einem absolut positionierten Div gestoßen.<br
/> Ich musste ein Div absolut positionieren doch sein parent Container sollte die Höhe entsprechend anpassen.<br
/> Da man ja mit absolute das Div aus dem Dokumentenfluß reißt geht das mit herkömmlichem CSS leider nicht.</p><p>Da für die Seite MooTools im Einsatz ist hab ich das ganze mit folgenden 2 Zeilen code gelöst:</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p883code24'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p88324"><td
class="line_numbers"><pre>1
2
</pre></td><td
class="code" id="p883code24"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> height <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Number<span style="color: #009900;">&#40;</span>$$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#content'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getStyle</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'height'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">map</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>it<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000066; font-weight: bold;">return</span> it.<span style="color: #660066;">toInt</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#container'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">setStyle</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'height'</span><span style="color: #339933;">,</span> height <span style="color: #339933;">+</span> <span style="color: #CC0000;">420</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><p>wobei +420 die Höhe des oberen Bereichs (Header, Navi, Newsblock) darstellt.<br
/> Liest man mit MooTools getStyle(&#8216;height&#8217;) die Höhe des Containers aus so bekommt man z.b. 800px raus, daher wird die Funktion toInt() benötigt welche aus diesem String die Number 800 macht.</p><h3  class="related_post_title">Ähnliche Artikel</h3><ul
class="related_post"><li>24. März 2011 -- <a
href="http://www.mysrc.de/mootools/mootools-menumatic-firefox-4-zweizeilig-problem/" title="MooTools MenuMatic &#8211; Firefox 4 zweizeilig Problem">MooTools MenuMatic &#8211; Firefox 4 zweizeilig Problem</a></li><li>16. Oktober 2009 -- <a
href="http://www.mysrc.de/jquery/praxistipp-jqtransform-width-bug/" title="Praxistipp &#8211; jqTransform width bug">Praxistipp &#8211; jqTransform width bug</a></li><li>5. August 2009 -- <a
href="http://www.mysrc.de/jquery/tipp-den-gleichen-selektor-nicht-mehrmals-aufrufen/" title="Tipp! Den gleichen Selektor nicht mehrmals aufrufen">Tipp! Den gleichen Selektor nicht mehrmals aufrufen</a></li></ul>]]></content:encoded> <wfw:commentRss>http://www.mysrc.de/mootools/praxistipp-position-absolute-parent-height-anpassen-mit-mootools/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Tipp! Den gleichen Selektor nicht mehrmals aufrufen</title><link>http://www.mysrc.de/jquery/tipp-den-gleichen-selektor-nicht-mehrmals-aufrufen/</link> <comments>http://www.mysrc.de/jquery/tipp-den-gleichen-selektor-nicht-mehrmals-aufrufen/#comments</comments> <pubDate>Wed, 05 Aug 2009 14:00:09 +0000</pubDate> <dc:creator>Oliver Storm</dc:creator> <category><![CDATA[jQuery]]></category> <category><![CDATA[Best Practice]]></category> <category><![CDATA[Tipp!]]></category> <guid
isPermaLink="false">http://www.mysrc.de/?p=829</guid> <description><![CDATA[Und noch ein kleiner Tipp! Oftmals kommt es vor das man einem Element mehrere Methoden mitgeben muss. Hier sollte man vermeiden den Selektor nicht zu oft zu verwenden. Anstatt: ?View Code JAVASCRIPT1 2 3 $&#40;'div.class'&#41;.css &#40;'color', '#000000'&#41;; $&#40;'div.class'&#41;.text &#40;'Hier steht Text'&#41;; $&#40;'div.class'&#41;.addClass &#40;'highlighted'&#41;; sollte man: ?View Code JAVASCRIPT1 2 3 4 var $div = $&#40;'div.class'&#41;; [...]]]></description> <content:encoded><![CDATA[<p>Und noch ein kleiner Tipp! Oftmals kommt es vor das man einem Element mehrere Methoden mitgeben muss.<br
/> Hier sollte man vermeiden den Selektor nicht zu oft zu verwenden.</p><p>Anstatt:</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p829code28'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p82928"><td
class="line_numbers"><pre>1
2
3
</pre></td><td
class="code" id="p829code28"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div.class'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span> <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'color'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'#000000'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div.class'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span> <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Hier steht Text'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div.class'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span> <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'highlighted'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><p>sollte man:</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p829code29'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p82929"><td
class="line_numbers"><pre>1
2
3
4
</pre></td><td
class="code" id="p829code29"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> $div <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div.class'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$div.<span style="color: #660066;">css</span> <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'color'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'#000000'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$div.<span style="color: #660066;">text</span> <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Hier steht Text'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$div.<span style="color: #660066;">addClass</span> <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'highlighted'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><p>verwenden.</p><p>Alternativ kann man das ganze auch chainen.</p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p829code30'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p82930"><td
class="line_numbers"><pre>1
</pre></td><td
class="code" id="p829code30"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div.class'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span> <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'color'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'#000000'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span> <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Hier steht ein Text'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span> <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'highlighted'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><h3  class="related_post_title">Ähnliche Artikel</h3><ul
class="related_post"><li>16. Oktober 2009 -- <a
href="http://www.mysrc.de/jquery/praxistipp-jqtransform-width-bug/" title="Praxistipp &#8211; jqTransform width bug">Praxistipp &#8211; jqTransform width bug</a></li><li>5. August 2009 -- <a
href="http://www.mysrc.de/jquery/tipp-highlighten-eins-li%c2%b4s-innerhalb-einer-list-mit-jquery/" title="Tipp! &#8211; Highlighten eins li´s innerhalb einer Liste mit jQuery">Tipp! &#8211; Highlighten eins li´s innerhalb einer Liste mit jQuery</a></li><li>24. März 2011 -- <a
href="http://www.mysrc.de/mootools/mootools-menumatic-firefox-4-zweizeilig-problem/" title="MooTools MenuMatic &#8211; Firefox 4 zweizeilig Problem">MooTools MenuMatic &#8211; Firefox 4 zweizeilig Problem</a></li></ul>]]></content:encoded> <wfw:commentRss>http://www.mysrc.de/jquery/tipp-den-gleichen-selektor-nicht-mehrmals-aufrufen/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Tipp! &#8211; Highlighten eins li´s innerhalb einer Liste mit jQuery</title><link>http://www.mysrc.de/jquery/tipp-highlighten-eins-li%c2%b4s-innerhalb-einer-list-mit-jquery/</link> <comments>http://www.mysrc.de/jquery/tipp-highlighten-eins-li%c2%b4s-innerhalb-einer-list-mit-jquery/#comments</comments> <pubDate>Wed, 05 Aug 2009 10:05:44 +0000</pubDate> <dc:creator>Oliver Storm</dc:creator> <category><![CDATA[jQuery]]></category> <category><![CDATA[Best Practice]]></category> <category><![CDATA[Plugin]]></category> <category><![CDATA[Tipp!]]></category> <guid
isPermaLink="false">http://www.mysrc.de/?p=822</guid> <description><![CDATA[Anbei nur ein kleiner Tipp! wie man einfach ein li auf klick highlighten kann und dem aktiven li die Klasse wieder entzieht. CSS: ?View Code CSS1 2 3 .active&#123; color: red; &#125; HTML: ?View Code HTML1 2 3 4 5 6 &#60;ul id=&#34;liste&#34;&#62; &#60;li&#62;eins&#60;/li&#62; &#60;li&#62;zwei&#60;/li&#62; &#60;li&#62;drei&#60;/li&#62; &#60;li&#62;vier&#60;/li&#62; &#60;/ul&#62; jQuery: ?View Code JAVASCRIPT1 2 3 4 [...]]]></description> <content:encoded><![CDATA[<p>Anbei nur ein kleiner Tipp! wie man einfach ein <strong>li auf klick highlighten</strong> kann und dem aktiven li die Klasse wieder entzieht.</p><p><strong>CSS:</strong></p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p822code34'); return false;">View Code</a> CSS</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p82234"><td
class="line_numbers"><pre>1
2
3
</pre></td><td
class="code" id="p822code34"><pre class="css" style="font-family:monospace;">        .active<span style="color: #00AA00;">&#123;</span>
	      <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">;</span>
        <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div><p><strong>HTML:</strong></p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p822code35'); return false;">View Code</a> HTML</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p82235"><td
class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td
class="code" id="p822code35"><pre class="html" style="font-family:monospace;">&lt;ul id=&quot;liste&quot;&gt;
	&lt;li&gt;eins&lt;/li&gt;
	&lt;li&gt;zwei&lt;/li&gt;
	&lt;li&gt;drei&lt;/li&gt;
	&lt;li&gt;vier&lt;/li&gt;
&lt;/ul&gt;</pre></td></tr></table></div><p><strong>jQuery:</strong></p><div
class="wp_codebox_msgheader"><span
class="right"><sup><a
href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span
style="color: #99cc00">?</span></a></sup></span><span
class="left"><a
href="javascript:;" onclick="javascript:showCodeTxt('p822code36'); return false;">View Code</a> JAVASCRIPT</span><div
class="codebox_clear"></div></div><div
class="wp_codebox"><table><tr
id="p82236"><td
class="line_numbers"><pre>1
2
3
4
5
</pre></td><td
class="code" id="p822code36"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#liste li'</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>
			$<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;">closest</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'active'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">siblings</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'active'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div><p><a
title="li highlighten " href="http://www.mysrc.de/demo/li-highlighten" target="_blank">Eine kleine Demo des ganzen</a></p><h3  class="related_post_title">Ähnliche Artikel</h3><ul
class="related_post"><li>16. Oktober 2009 -- <a
href="http://www.mysrc.de/jquery/praxistipp-jqtransform-width-bug/" title="Praxistipp &#8211; jqTransform width bug">Praxistipp &#8211; jqTransform width bug</a></li><li>23. März 2010 -- <a
href="http://www.mysrc.de/jquery/praxistipp-%e2%80%93-jqtransform-bug-bei-input-in-firefox-3-5-2/" title="Praxistipp – jqTransform Bug bei input in Firefox > 3.5.2">Praxistipp – jqTransform Bug bei input in Firefox > 3.5.2</a></li><li>20. Oktober 2009 -- <a
href="http://www.mysrc.de/jquery/praxistipp-jqtransform-button-width-einstellen/" title="Praxistipp: jqTransform Button width einstellen">Praxistipp: jqTransform Button width einstellen</a></li></ul>]]></content:encoded> <wfw:commentRss>http://www.mysrc.de/jquery/tipp-highlighten-eins-li%c2%b4s-innerhalb-einer-list-mit-jquery/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
