Skip to content

Instantly share code, notes, and snippets.

@kikegarcia
Created July 15, 2013 14:12
Show Gist options
  • Save kikegarcia/6000234 to your computer and use it in GitHub Desktop.
Save kikegarcia/6000234 to your computer and use it in GitHub Desktop.
hidden div that shows in certain time with Jquery Delay and goes away with a click outside of it
<div id="suscribecall" style="right: -500px; width:314px;height:390px;position: absolute; background-color:#dd7051; z-index: 100;"></div>
<script>
$(document).ready(function() {
$('div#showbanners').show('slow');
$('#suscribecall').delay(10000).animate({
right: "0px"
}, 'slow');
$(this).delay(10000).queue(function(){$(document).mouseup(function (e)
{
var container = $("#suscribecall");
if (!container.is(e.target) && container.has)
{
container.animate({ right: "-500px", backgroundColor:'transparent'} , 500);
$('#suscribebutton').show();
}
});
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment