<?xml version="1.0" encoding="UTF-8"?>
<codes type="array">
  <code>
    <code>$('a.popup').live('click', function(){
	newwindow=window.open($(this).attr('href'),'','height=200,width=150');
	if (window.focus) {newwindow.focus()}
	return false;
});</code>
    <created-at type="datetime">2009-12-16T00:12:50Z</created-at>
    <description></description>
    <id type="integer">210</id>
    <language-id type="integer">19</language-id>
    <privated type="boolean">false</privated>
    <title>clean way to open a popup window</title>
    <updated-at type="datetime">2009-12-16T00:12:50Z</updated-at>
    <user-id type="integer">7</user-id>
  </code>
  <code>
    <code>$('h1') // elementos h1
$('#meuID') // elementos com id &quot;meuID&quot;
$('.minhaClasse') // elementos definidos com a classe &quot;minhaClasse&quot;
$('[width]') // elementos que possuem o atributo width definido
$('[width=500]') // elementos que possuem o atributo width definido como 500
$('img[width=300]') // imagens que possuem largura = 300
$('img[src$=png]') // imagens com final png
$('a[href^=http://localhost]') // links que comecem com http://localhost
$('a[href$=pdf]') // links com final pdf
$('a[href*=www]') // links que cont&#233;m www
$(':empty') // elementos vazio
$('div:empty') // elementos div vazios
$(':has(p)') // todos elementos que tenham um par&#225;grafo
$('div:has(a)'); // elementos div que possuem link
$(&quot;p:contains('dinei')&quot;) // par&#225;grafos que cont&#233;m a palavra &quot;dinei&quot;
$(&quot;p:eq(0)&quot;) // seleciona o primeiro elemento p</code>
    <created-at type="datetime">2009-11-25T22:45:07Z</created-at>
    <description>http://docs.jQuery.com/DOM/Traversing/Selectors</description>
    <id type="integer">207</id>
    <language-id type="integer">19</language-id>
    <privated type="boolean">false</privated>
    <title>seletores do jquery</title>
    <updated-at type="datetime">2009-11-25T22:45:07Z</updated-at>
    <user-id type="integer">7</user-id>
  </code>
  <code>
    <code>&lt;script type=&quot;text/javascript&quot;&gt;
		jQuery.networkDetection = function(url,interval){
			
			var url = url;
			var interval = interval;
			online = false;
			this.StartPolling = function(){
				this.StopPolling();
				this.timer = setInterval(poll, interval);
			};
			
			this.StopPolling = function(){
				clearInterval(this.timer);
			};
			
			this.setPollInterval= function(i) {
				interval = i;
			};
			
			this.getOnlineStatus = function(){
				return online;
			};
			
			function poll() {
				jQuery.ajax({
					type: &quot;POST&quot;,
					url: url,
					dataType: &quot;text&quot;,
					error: function(){
						online = false; 
						jQuery(document).trigger('status.networkDetection',[false]);
					},
					success: function(){
						online = true; 
						jQuery(document).trigger('status.networkDetection',[true]);
					}
				});
			};
			
			
		};
					
		jQuery(document).ready(function(){
			
			network = new jQuery.networkDetection(&quot;/poll&quot;, 5000);
			network.StartPolling();
			
			jQuery(document).bind(&quot;status.networkDetection&quot;, function(e, status){	
				// subscribers can be namespaced with multiple classes
				subscribers = jQuery('.subscriber.networkDetection');
				// publish notify.networkDetection to subscribers
				subscribers.trigger(&quot;notify.networkDetection&quot;, [status])
				/*
				other logic based on network connectivity could go here
				use google gears offline storage etc
				maybe trigger some other events
				*/
			});
			
			/* 
			Listen for notify.networkDetection events. This could equally be listening
			directly to status.networkDetection events
			*/
			jQuery('#notifier').bind(&quot;notify.networkDetection&quot;,function(e, online){
				// the following simply demonstrates
				notifier = jQuery(this);
				if(online){
					if (!notifier.hasClass(&quot;online&quot;)){
						notifier.hide();
						jQuery(this).addClass(&quot;online&quot;).removeClass(&quot;offline&quot;).text(&quot;Voc&#234; esta online&quot;);
					}
				}else{
					if (!notifier.hasClass(&quot;offline&quot;)){
						notifier.show();
						jQuery(this).addClass(&quot;offline&quot;).removeClass(&quot;online&quot;).text(&quot;Sua conex&#227;o esta falhando&quot;);
					}
				};
			});
			
		});



&lt;/script&gt;

&lt;style type=&quot;text/css&quot;&gt;
	
	* {
		font-family:verdana, arial, helvetica, sans-serif;
		font-weight:bold;
	}
	
	#notifier{
		border:1px solid #CCCCCC;
		color:#333333;
		margin-left:36%;
		padding:20px;
		position:absolute;
		text-align:center;
		width:300px;
	}
	
	#notifier.online{
		color:#fff;
		background:#3c3;
		border-color:#3c3;
	}
	
	#notifier.offline{
		color:#fff;
		background:#f66;
		border-color:#f66;
	}
	
	
&lt;/style&gt;


&lt;body class=&quot;pagLogin&quot;&gt;
	
	&lt;div id=&quot;notifier&quot; style=&quot;display: none;&quot; class=&quot;subscriber networkDetection online&quot;&gt;ONLINE&lt;/div&gt;
	
&lt;/body&gt;</code>
    <created-at type="datetime">2009-09-11T03:41:29Z</created-at>
    <description>Como detectar que seu browser estar offline ou online utilizando de jQuery?
Esse c&#243;digo foi montado e capturado na internet. Por tanto n&#225;o &#233; meu.
Agora n&#227;o sei de quem s&#227;o os cr&#233;ditos.

Com ele temos como mostrar para o usu&#225;rio que sua conex&#227;o esta offline.
</description>
    <id type="integer">203</id>
    <language-id type="integer">19</language-id>
    <privated type="boolean">false</privated>
    <title>Detectar se o browser estar offline ou online</title>
    <updated-at type="datetime">2009-09-11T03:41:29Z</updated-at>
    <user-id type="integer">37</user-id>
  </code>
  <code>
    <code>function copyToClipBoard(id) {
    Copied = document.getElementById('id').innerText.createTextRange();
    Copied.execCommand(&quot;Copy&quot;);
}</code>
    <created-at type="datetime">2009-08-22T15:59:21Z</created-at>
    <description></description>
    <id type="integer">201</id>
    <language-id type="integer">19</language-id>
    <privated type="boolean">false</privated>
    <title>copy to clipboard</title>
    <updated-at type="datetime">2009-08-22T15:59:21Z</updated-at>
    <user-id type="integer">7</user-id>
  </code>
  <code>
    <code>   function popup(url) {
        newWindow = window.open(url, 'name', 'height=400,width=335,scrollbars=yes');
        if (window.focus) { newWindow.focus() }
            return false;
    }

// &lt;a href=&quot;link.html&quot; onclick=&quot;popup('link.html');&quot;&gt;Link&lt;/a&gt;</code>
    <created-at type="datetime">2009-08-22T15:40:47Z</created-at>
    <description>http://www.quirksmode.org/js/popup.html</description>
    <id type="integer">199</id>
    <language-id type="integer">19</language-id>
    <privated type="boolean">false</privated>
    <title>unobstrusive popup</title>
    <updated-at type="datetime">2009-08-22T15:40:47Z</updated-at>
    <user-id type="integer">7</user-id>
  </code>
  <code>
    <code>		$(document).ready(function() {
			$('dd').toggle();
			$('dt').click(function() {$(this).next('dd').toggle('slideDown');});
		});</code>
    <created-at type="datetime">2009-08-22T15:29:33Z</created-at>
    <description></description>
    <id type="integer">195</id>
    <language-id type="integer">19</language-id>
    <privated type="boolean">false</privated>
    <title>hide/show dl list with jquery</title>
    <updated-at type="datetime">2009-08-22T15:29:33Z</updated-at>
    <user-id type="integer">7</user-id>
  </code>
  <code>
    <code>/* IE6 - pseudo class :hover */ 
$(document).ready(function(){ 
	if(jQuery.browser.msie &amp;&amp; jQuery.browser.version&lt;7){ 
		$('[class*=&quot;bla&quot;]').hover( 
		function () { 
			$(this).addClass('hover'); 
		}, 
		function () { 
			$(this).removeClass('hover'); 
		} 
		); 
	} 
});</code>
    <created-at type="datetime">2009-08-10T20:42:45Z</created-at>
    <description></description>
    <id type="integer">190</id>
    <language-id type="integer">19</language-id>
    <privated type="boolean">false</privated>
    <title>hover for ie 6</title>
    <updated-at type="datetime">2009-08-10T20:42:45Z</updated-at>
    <user-id type="integer">7</user-id>
  </code>
  <code>
    <code>(function ($) {
// VERTICALLY ALIGN FUNCTION
$.fn.vAlign = function() {
	return this.each(function(i){
	var ah = $(this).height();
	var ph = $(this).parent().height();
	var mh = (ph - ah) / 2;
	$(this).css('margin-top', mh);
	});
};
})(jQuery);

// $('#mydiv').vAlign();</code>
    <created-at type="datetime">2009-08-07T20:13:04Z</created-at>
    <description>http://www.seodenver.com/simple-vertical-align-plugin-for-jquery/</description>
    <id type="integer">189</id>
    <language-id type="integer">19</language-id>
    <privated type="boolean">false</privated>
    <title>vertical align plugin for jquery</title>
    <updated-at type="datetime">2009-08-07T20:13:04Z</updated-at>
    <user-id type="integer">7</user-id>
  </code>
  <code>
    <code>jQuery.fn.fadeSliderToggle = function(settings) {
 	 settings = jQuery.extend({
		speed:500,
		easing : &quot;swing&quot;
	}, settings)
	
	caller = this
 	if($(caller).css(&quot;display&quot;) == &quot;none&quot;){
 		$(caller).animate({
 			opacity: 1,
 			height: 'toggle'
 		}, settings.speed, settings.easing);
	}else{
		$(caller).animate({
 			opacity: 0,
 			height: 'toggle'
 		}, settings.speed, settings.easing);
	}
};

// use: $('#my_div').fadeSliderToggle();</code>
    <created-at type="datetime">2009-07-12T16:38:01Z</created-at>
    <description>from: http://www.position-absolute.com/articles/jquery-fade-and-slide-toggle-plugin/</description>
    <id type="integer">185</id>
    <language-id type="integer">19</language-id>
    <privated type="boolean">false</privated>
    <title>jquery fade and slide toggle plugin</title>
    <updated-at type="datetime">2009-07-12T16:38:01Z</updated-at>
    <user-id type="integer">7</user-id>
  </code>
  <code>
    <code>$(document).ready(function() { jQuery.fn.each( function(i) { console.log(i); }); });</code>
    <created-at type="datetime">2009-06-21T21:05:02Z</created-at>
    <description></description>
    <id type="integer">179</id>
    <language-id type="integer">19</language-id>
    <privated type="boolean">false</privated>
    <title>list all jquery function with firebug</title>
    <updated-at type="datetime">2009-06-21T21:05:02Z</updated-at>
    <user-id type="integer">7</user-id>
  </code>
</codes>
