<?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>monkey-business.biz &#187; jQuery</title> <atom:link href="http://www.monkey-business.biz/tag/jquery/feed/" rel="self" type="application/rss+xml" /><link>http://www.monkey-business.biz</link> <description>Belästigung der Allgemeinheit - der private Weblog</description> <lastBuildDate>Tue, 24 Jan 2012 14:53:33 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>daily</sy:updatePeriod> <sy:updateFrequency>4</sy:updateFrequency> <item><title>Google Maps Routen mit jQuery in Shadowbox anzeigen</title><link>http://www.monkey-business.biz/1896/google-maps-routen-mit-jquery-in-shadowbox-anzeigen/</link> <comments>http://www.monkey-business.biz/1896/google-maps-routen-mit-jquery-in-shadowbox-anzeigen/#comments</comments> <pubDate>Sun, 15 Jan 2012 22:18:53 +0000</pubDate> <dc:creator>Loaden</dc:creator> <category><![CDATA[Belästigung der Allgemeinheit - mein privater Weblog]]></category> <category><![CDATA[Google Maps]]></category> <category><![CDATA[Highlighting]]></category> <category><![CDATA[Javascript]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[Shadowbox.js]]></category> <category><![CDATA[target="_blank"]]></category> <category><![CDATA[Tutorial]]></category> <category><![CDATA[Webdesign]]></category><guid isPermaLink="false">http://www.monkey-business.biz/?p=1896</guid> <description><![CDATA[Dem Besucher die Möglichkeit zu geben die Anfahrt zu einem Unternehmensstandort berechnen zu lassen ist heut zu tage ein muss für jede Unternehmens Webseite. Unschön ist ein weiteres Fenster / Pop-Up das sich öffnet nur um eine Anfahrtsskizze über die Google Maps Funktion anzuzeigen. Im selben Fenster wollen wir Google Maps nicht öffnen. Wir wollen [...]]]></description> <content:encoded><![CDATA[<p>Dem Besucher die Möglichkeit zu geben die Anfahrt zu einem Unternehmensstandort berechnen zu lassen ist heut zu tage ein muss für jede Unternehmens Webseite. Unschön ist ein weiteres Fenster / Pop-Up das sich öffnet nur um eine Anfahrtsskizze über die Google Maps Funktion anzuzeigen. Im selben Fenster wollen wir Google Maps nicht öffnen. Wir wollen den Besucher nicht von der Webseite weg manövrieren.</p><p>Ein Lösungsvorschlag von mir ist das öffnen von Google Maps in einer Highlighting-Box wie der Shadowbox. Als angenehm empfunden haben viele Besucher einen zweiten Link für die Google Routen Berechnung. Bei den Vorhaben seine Anfahrtsroute zu berechnen sollte man dem Besucher nicht im Interface / Platz beschneiden.</p><p>Hierzu habe ich mithilfe von jQuery ein kleines Script geschrieben, das am besten in den Header des Dokumentes, nach dem jQuery Framework und der Shadowbox, eingebunden wird. Ein paar HTML Elemente müssen wir ebenfalls auf der Webseite platzieren um dem Besucher Interaktion zu ermöglichen.</p><p>Das Beispiel auf dieser Seite beeinhaltet die Anzeige der Anfahrt, dargestellt in der Shadowbox, ins Watergate nach Berlin.</p> <input type="text" name="saddr" title="Ihre Adresse" class="input-text" id="google-route-f"> <a href="http://maps.google.de?daddr=Falckensteinstr. 49, 10997 Berlin&amp;&#038;output=embed&#038;iframe=1saddr=" title="Anfahrt anzeigen" id="google-route-b" target="_blank">Anfahrt anzeigen</a>&nbsp;&bull;&nbsp;<a href="http://maps.google.de?daddr=Falckensteinstr. 49, 10997 Berlin&amp;saddr=" title="Route berechnen" id="google-route-d" target="_blank">Route berechnen</a></p><link rel="stylesheet" type="text/css" href="http://www.monkey-business.biz/wp-content/uploads/2011/07/shadowbox/shadowbox.css" /><script type="text/javascript" src="http://www.monkey-business.biz/wp-content/uploads/2011/07/shadowbox/shadowbox.js"></script><script type="text/javascript">
jQuery(document).ready(function() {
Shadowbox.init({
    handleOversize: 'drag',
    modal: true
});
jQuery('#google-route-b').bind('click', function() {
    Shadowbox.open({
	   content: jQuery(this).attr('href')+jQuery('#google-route-f').attr('value'),
  	   player:  'iframe'
   });
   return false;
});
jQuery('#google-route-d').bind('click', function() {
	jQuery(this).attr('href', jQuery(this).attr('href')+jQuery('#google-route-f').attr('value'));
	return true;
});
});
</script><br /> <strong>Fremd Beispiel 2:</strong> &#8220;<a href="http://www.loaden-development.com/psd-zu-wordpress-theme/#kontakt" target="_blank" title="PSD zu WordPress Theme">PSD zu WordPress Theme</a>&#8221; <small>(unten auf der Seite)</small></p><p>Die Einrichtung um Google Maps in der Shadowbox öffnen zu lassen gestaltet sich, wenn man weiß wie, sehr einfach.<br /> Das jQuery Framework und die Shadowbox müssen vor Script Aufruf in das HTML Dokument eingebunden werden. Dies geschieht im Kopfbereich folgerndermaßen:</p><div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">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;shadowbox.css&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<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;jquery.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>
<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;shadowbox.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></pre></div></div><p>Aktuelle Downloads findest du hier:</p><ul><li><a href="http://jquery.com/" title="jQuery Framework" target="_blank">jQuery Framework</a></li><li><a href="http://www.shadowbox-js.com/download.html" title="Shadowbox" target="_blank">Shadowbox</a></li></ul><p>Dieses Script bindet das &#8220;click&#8221; Event an den Link und macht es uns möglich nach einem Klick eines Benutzers mit einer eigenen Funktion zu reagieren. In unserer Funktion werden wird der Wert des Formularfeldes ermittelt und als GET Parameter (Adresse) für den iFrame der Shadowbox verwendet.</p><p>Das zweite &#8220;click&#8221; Event öffnet ein neues Fenster / Tab mit der Adresse aus dem Formularfeld für die Google Routen Berechnung.</p><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery<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>
   Shadowbox.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
       handleOversize<span style="color: #339933;">:</span> <span style="color: #3366CC;">'drag'</span><span style="color: #339933;">,</span>
       modal<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span>
   <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#google-route-b'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</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>
       Shadowbox.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	   content<span style="color: #339933;">:</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;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'href'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span>jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#google-route-f'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'value'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
  	   player<span style="color: #339933;">:</span>  <span style="color: #3366CC;">'iframe'</span>
      <span style="color: #009900;">&#125;</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>
   jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#google-route-d'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</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>
	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;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'href'</span><span style="color: #339933;">,</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;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'href'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span>jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#google-route-f'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'value'</span><span style="color: #009900;">&#41;</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;">true</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></div></div><p>Der Selektor #google-route-b steht hierbei für den Link auf den geklickt werden muss um unser &#8220;Formular&#8221; abzusenden. #google-route-f bezeichnet das Feld mit der Adresse des Besuchers. Die Rückgabe von &#8220;false&#8221; am Ende der Funktion verhindert das öffnen von den Google Routen im selben Fenster.</p><p>#google-route-d kennzeichnet den Link um die Google Routen Berechnung. Nach dem Einfügen der Adresse aus dem Input Feld in den Link wird &#8220;true&#8221; zurück gegeben um dem Browser zu signalisieren weiter mit seiner standard Link Routine zu arbeiten.</p><div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;saddr&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Ihre Adresse&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;input-text&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;google-route-f&quot;</span>&gt;</span>
<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://maps.google.de?daddr=***DEINE STRAßE, DEINE STADT***&amp;amp;&amp;output=embed&amp;saddr=&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Anfahrt anzeigen&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;google-route-b&quot;</span> <span style="color: #000066;">target</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;_blank&quot;</span>&gt;</span>Anfahrt anzeigen<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
<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://maps.google.de?daddr=***DEINE STRAßE, DEINE STADT***&amp;amp;saddr=&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Route berechnen&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;google-route-d&quot;</span> <span style="color: #000066;">target</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;_blank&quot;</span>&gt;</span>Route berechnen<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span></pre></div></div><p>***DEINE STRAßE, DEINE STADT*** ist natürlich durch die jeweilige Firmenadresse zu ersetzen.</p> ]]></content:encoded> <wfw:commentRss>http://www.monkey-business.biz/1896/google-maps-routen-mit-jquery-in-shadowbox-anzeigen/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>jQuery: Externe Links in neuem Fenster / Tab öffnen</title><link>http://www.monkey-business.biz/2503/jquery-externe-links-in-neuem-fenster-tab-offnen/</link> <comments>http://www.monkey-business.biz/2503/jquery-externe-links-in-neuem-fenster-tab-offnen/#comments</comments> <pubDate>Wed, 16 Nov 2011 10:11:22 +0000</pubDate> <dc:creator>Loaden</dc:creator> <category><![CDATA[Belästigung der Allgemeinheit - mein privater Weblog]]></category> <category><![CDATA[Javascript]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[target="_blank"]]></category> <category><![CDATA[Usability]]></category> <category><![CDATA[Webdesign]]></category><guid isPermaLink="false">http://www.monkey-business.biz/?p=2503</guid> <description><![CDATA[Ob es ratsam ist externe Links in neuem Fenster / Tab zu öffnen bzw. Verweise generell in neuen Tabs / Fenstern zu öffnen ist umstritten. Grundsätzlich werden dabei zwei sinnvolle Ansätze vertreten. Ansatz A Dem Benutzer ist es selbst überlassen wie sich Links nach anklicken verhalten. Alle Links öffnen sich im selben Fenster. Ansatz B [...]]]></description> <content:encoded><![CDATA[<p>Ob es ratsam ist externe Links in neuem Fenster / Tab zu öffnen bzw. Verweise generell in neuen Tabs / Fenstern zu öffnen ist umstritten. Grundsätzlich werden dabei zwei sinnvolle Ansätze vertreten.</p><ul><li>Ansatz A<p>Dem Benutzer ist es selbst überlassen wie sich Links nach anklicken verhalten. Alle Links öffnen sich im selben Fenster.</p></li><li>Ansatz B<p>Dem Benutzer wird die Entscheidung abgenommen und externe Links öffnen sich in einem neuen Fenster / Tab. Hierbei wird die eigentliche Seite nicht verlassen.</p></li></ul><p>Ich selbst tendiere zu Ansatz B. Sollte es, aus welchen Gründen auch immer, nicht möglich sein ein target=&#8221;_blank&#8221; Server seitig in das HTML Dokument einzufügen verwende ich eine Javascript Funktion auf jQuery Basis.</p><h2 style="font-size: 12px;">Externe Links in neuem Fenster öffnen -<span style="font-size: 22px;">extendable</span></h2><p>Diese Methode ist insbesondere interessant wenn verschiedene Faktoren für die Prüfung eines Links erforderlich sind.</p><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">/* Nicht vergessen das jQuery Framework vor diesem Snippet einzubinden  */</span>
jQuery<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: #003366; font-weight: bold;">var</span> getdomainname <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>url<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">return</span> url.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'/'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">':'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #003366; font-weight: bold;">var</span> targetblank <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>	
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">location</span>.<span style="color: #660066;">host</span> <span style="color: #339933;">!=</span> getdomainname<span style="color: #009900;">&#40;</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;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'href'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</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;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'target'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'_blank'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'body a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span>targetblank<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>Mithilfe dieser Funktion können jederzeit auch einzelne Bereiche der Internetseite angesprochen werden. Strukturen ohne externe Links sollten auch aus Performance Gründen nicht von der Funktion überprüft werden.</p><p>Weitere Informationen zur Funktion getdomainname() findest du in meinem vorherigen Post: <a href="http://www.monkey-business.biz/2499/javascript-domain-name-ermitteln-js-get-domain-name-via-url/" title="Javascript: Domain Name ermitteln (JS: get domain name) via URL">Javascript: Domain Name ermitteln (JS: get domain name) via URL</a></p><h2 style="font-size: 12px;">Externe Links in neuem Fenster öffnen &#8211; <span style="font-size: 22px;">quicky</span></h2><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">/* Nicht vergessen das jQuery Framework vor diesem Snippet einzubinden  */</span>
jQuery<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>
        jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a[href^='http']:not([href^='&quot;</span><span style="color: #339933;">+</span>window.<span style="color: #660066;">location</span>.<span style="color: #660066;">host</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;'])&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'target'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'_blank'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>Diese Methode fügt allen a Tags mit einem http:// am Anfang des href Attributes das nicht der aktuellen Domain entspricht das target=&#8221;_blank&#8221; hinzu. Nicht zu vergessen ist, das auch hier mit Hilfe des Selektors aus einzelne Bereiche des HTML Dokuments angesprochen werden können. Dieser Vorgehensweise fehlt es leider an Erweiterbarkeit. Insbesondere für Filter Regeln zur die Auswahl der Links.</p> ]]></content:encoded> <wfw:commentRss>http://www.monkey-business.biz/2503/jquery-externe-links-in-neuem-fenster-tab-offnen/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>jQuery Interfaces Fisheye position: fixed; Patch</title><link>http://www.monkey-business.biz/181/jquery-interfaces-fisheye-position-fixed-patch/</link> <comments>http://www.monkey-business.biz/181/jquery-interfaces-fisheye-position-fixed-patch/#comments</comments> <pubDate>Mon, 04 Jan 2010 20:20:43 +0000</pubDate> <dc:creator>Loaden</dc:creator> <category><![CDATA[Belästigung der Allgemeinheit - mein privater Weblog]]></category> <category><![CDATA[Bugfix]]></category> <category><![CDATA[Fisheye]]></category> <category><![CDATA[Javascript]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[position: fixed;]]></category><guid isPermaLink="false">http://www.monkey-business.biz/?p=181</guid> <description><![CDATA[(to the english part of the post)Dir wird in diesem Artikel der neue jQuery Interfaces Fisheye position: fixed; Patch zum herunterladen angeboten. Mit diesem Bugfix funktioniert das Fisheye auch nach dem Scrollen bei fixer Positionierung. Die Vorgehensweise ist denkbar einfach. Es muss nur der Bugfix nach der jQuery interfaces Datei eingebunden werden. Ein Beispiel folgt. [...]]]></description> <content:encoded><![CDATA[<p><a href="#jquery-interfaces-fisheye-position-fixed-patch_english">(to the english part of the post)</a><a name="jquery-interfaces-fisheye-position-fixed-patch_deutsch"></a><br />Dir wird in diesem Artikel der neue jQuery Interfaces Fisheye position: fixed; Patch zum herunterladen angeboten. Mit diesem Bugfix funktioniert das Fisheye auch nach dem Scrollen bei fixer Positionierung. Die Vorgehensweise ist denkbar einfach. Es muss nur der Bugfix nach der jQuery interfaces Datei eingebunden werden. Ein Beispiel folgt.</p><div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;jquery.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span> <span style="color: #808080; font-style: italic;">&lt;!--- jQuery Framework einbinden ---&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;interface.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span> <span style="color: #808080; font-style: italic;">&lt;!--- jQuery interfaces Plugin einbinden ---&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;fisheye_patched.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span> <span style="color: #808080; font-style: italic;">&lt;!--- hier den Bugfix einbinden ---&gt;</span></pre></div></div><h3><a href="/wp-content/uploads/2010/01/fisheye_patched.zip" title="Fisheye position: fixed; Bugfix herunterladen">Fisheye position: fixed; Bugfix herunterladen</a></h3><p>Zip Datei enthält Javascript Datei.</p><p>Weitere Verweise zum Thema:</p><ul><li><a href="/wp-content/uploads/2010/05/fisheye/index.html" title="Patch Demo" target="_blank">jQuery Interface Fisheye Fix Demo</a></li><li><a href="/wp-content/uploads/2010/02/interfaces.zip">jQuery Interface herunterladen</a></li><li><a href="http://www.ndesign-studio.com/blog/mac/css-dock-menu" target="_blank">jQuery Interface Fisheye Anleitung</a></li></ul><hr /> <a href="#jquery-interfaces-fisheye-position-fixed-patch_deutsch">(Zum deutschen Teil des Artikels)</a><br /> <a name="jquery-interfaces-fisheye-position-fixed-patch_english"></a><p>In this post you will be offered to download the jQuery Interfaces Fisheye position: fixed; patch. With this patch the Fisheye works after scrolling while it&#8217;s fixed positioned. The procedure is simple. You only need to include the bugfix after including the jQuery inferfaces file. An example follows.</p><div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;jquery.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span> <span style="color: #808080; font-style: italic;">&lt;!--- include jQuery Framework ---&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;interface.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span> <span style="color: #808080; font-style: italic;">&lt;!--- include jQuery interfaces plugin ---&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;fisheye_patched.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span> <span style="color: #808080; font-style: italic;">&lt;!---include the bugfix ---&gt;</span></pre></div></div><h3><a href="/wp-content/uploads/2010/01/fisheye_patched.zip" title="Fisheye position: fixed; bugfix download">Fisheye position: fixed; bugfix download</a></h3><p>Zip file includes javascript file.</p><p>More links to this subject:</p><ul><li><a href="/wp-content/uploads/2010/05/fisheye/index.html" title="Fixed demo" target="_blank">jQuery Interface Fisheye fix demo</a></li><li><a href="/wp-content/uploads/2010/02/interfaces.zip">jQuery Interface download</a></li><li><a href="http://www.ndesign-studio.com/blog/mac/css-dock-menu" target="_blank">jQuery Interface Fisheye tutorial</a></li></ul> ]]></content:encoded> <wfw:commentRss>http://www.monkey-business.biz/181/jquery-interfaces-fisheye-position-fixed-patch/feed/</wfw:commentRss> <slash:comments>30</slash:comments> </item> <item><title>jQuery: prüfen ob ein Element existiert</title><link>http://www.monkey-business.biz/119/jquery-prufen-ob-ein-element-existiert/</link> <comments>http://www.monkey-business.biz/119/jquery-prufen-ob-ein-element-existiert/#comments</comments> <pubDate>Tue, 22 Dec 2009 18:31:02 +0000</pubDate> <dc:creator>Loaden</dc:creator> <category><![CDATA[Belästigung der Allgemeinheit - mein privater Weblog]]></category> <category><![CDATA[Entwicklung]]></category> <category><![CDATA[Framework]]></category> <category><![CDATA[Javascript]]></category> <category><![CDATA[jQuery]]></category><guid isPermaLink="false">http://www.monkey-business.biz/?p=119</guid> <description><![CDATA[Ich stand vor kurzem vor dem Problem in Javascript zu prüfen ob ein DIV Element in einem HTML Dokument existiert. Mir stand aus vorangehender Entwicklung das jQuery Framework zur Verfügung. Dabei produzierte ich folgenden Code: if &#40;$&#40;'div#divname'&#41;&#41; &#123; // Code ausführen, wenn DIV Element vorhanden. Funktioniert leider nicht &#125; Das klappte leider nicht, da der [...]]]></description> <content:encoded><![CDATA[<p>Ich stand vor kurzem vor dem Problem in <a href="/672/javascript-prufen-ob-ein-element-existiert/" title="Javascript: prüfen ob ein Element existiert">Javascript zu prüfen ob ein DIV Element</a> in einem HTML Dokument existiert. Mir stand aus vorangehender Entwicklung das jQuery Framework zur Verfügung. Dabei produzierte ich folgenden Code:</p><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><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;">'div#divname'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #006600; font-style: italic;">// Code ausführen, wenn DIV Element vorhanden. Funktioniert leider nicht</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p>Das klappte leider nicht, da der Einsatz der jQuery Selektor Funktion immer ein Objekt zurückliefert. Mir war klar das es sich hierbei um ein leeres Objekt handelt und ich nur auf die Länge prüfen müsste. Sollte die Länge 0 sein ist der DIV im aktuellen Dokument nicht vorhanden. Hier nun der Code mit dem es entgültig klappte:</p><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><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;">'div#divname'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #006600; font-style: italic;">// Code ausführen, wenn DIV Element vorhanden. Funktioniert!</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p>Ich verwende &gt; anstatt ==, da diese Methode auch bei CSS Klassen funktioniert und keine Nachteile in der Performance bietet. Klassen können mehrfach im Dokument vorkommen. Deswegen kann die Länge größer als 1 sein.</p><p><a href="http://api.jquery.com/category/selectors/" target="_blank" title="Selektoren - jQuery API">Mehr zum Thema jQuery Selektoren</a></p> ]]></content:encoded> <wfw:commentRss>http://www.monkey-business.biz/119/jquery-prufen-ob-ein-element-existiert/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 9/14 queries in 0.010 seconds using disk: basic

Served from: www.monkey-business.biz @ 2012-02-05 01:53:56 -->
