jQuery Plugin : .href(); 11.06.12 18:23
Caros usuários,
Este plugin criado por mim, totalmente do 0, faz com que o selector mude o destino, ou seja, o atributo href.
Código:
http://jsbin.com/uxiduj
Este plugin criado por mim, totalmente do 0, faz com que o selector mude o destino, ou seja, o atributo href.
Código:
- Código:
/*************************************************
* jQuery Plugin: href;
*
* TrY!, Power Pixel Fórum.
*
* jQuery('seletor').href('novo_link');
*
* John Resig, TrY!
*
* http://www.power-pixel.net/t21281-jquery-plugin-href
***************************************************/
jQuery(document).ready(function(){jQuery.fn.href = function(href){jQuery(this).attr('href', href);};jQuery('seletor').href('novo_link');});
- Código:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
http://jsbin.com/uxiduj