Skip to content

Instantly share code, notes, and snippets.

@byroncorrales
Created May 20, 2012 18:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save byroncorrales/2759141 to your computer and use it in GitHub Desktop.
Save byroncorrales/2759141 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
$(function() {
$elem = $('#actionbuttons');
// detectar el scroll de la ventana y fixear el elemento
$(window).bind('scroll', function() {
var windowTop = $(this).scrollTop();
if(windowTop>=240){
$elem.addClass('fixed');
}else{
// volver elemento a su lugar
$elem.removeClass('fixed');
}
});
$('a[href^="/uploads/fotos"]').each(function(index, item){
$(item).html('');
$(item).append('<img src="'+$(item).attr('href')+'" width="60" height="60">');
});
$('p:has(input[type="file"])').each(function(index, item){
$(item).children('a').addClass('imgpreview').siblings('input').addClass('inputreplace');
$(item).html(function(id, html){
return html.replace('Actualmente:', '').replace('Modificar:', '');
});
});
$('input[id*="clear"], label[for*="clear"]').addClass('hideclear');
//para definir el alto de las tabs igual a su contenido
var alto = $('.tab-content').height();
$('.nav-tab-media').height(alto);
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment