jQuery Snippets

if ($('.check-480px').css('float') == 'left') {
	$("#nav-main .dropdown-menu").attr("style", "display: none");
	$("#topmenu .dropdown-toggle").click(function(){
		var parentEl = $(this).closest('.dropdown');
		$(parentEl).find('.dropdown-menu').toggle('hide');
	}); 
}
$('#loginbox').on('click', function() {
    return false;
});

$(document).on('click', '#loginbox-close', function() {
    $('#loginbox').popover('hide');
});

//login box hide when click outside
$(document).on('click', function(e) {
    if(!$(e.target).closest('.popover').length) {
        $('#loginbox').popover('hide');
    }
});
//scroll to top	
$(window).scroll(function() {
    var $scrolltotop = $('#scrolltotop');
    
    if ($(this).scrollTop() > 100) {
        $scrolltotop.slideDown('fast');
    } else {
        $scrolltotop.slideUp('fast');
    }
    
    if ($('.post-top-meta').length) {
        postTopMetaScroll();
    }
});

$('#scrolltotop').click(function() {
    $('body,html').animate({
        scrollTop: 0
    }, 'fast');
    return false;
});
$('.confirmation').on('click', function () {
    return confirm('Are you sure?');
});

 

 

 

——————-