如何在单击外部元素(展开的内容区域)
时关闭/最小化当前展开的内容当前代码与演示......:
-(void) TakeScreenShot
{
if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, NO, [UIScreen mainScreen].scale);
else
UIGraphicsBeginImageContext(self.view.bounds.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
NSData * data = UIImagePNGRepresentation(image);
[data writeToFile:@"foo.png" atomically:YES];
}

答案 0 :(得分:1)
$.ajax({
type: "POST",
url: URL,
data: {id: id},
success: function (result) {
$(".modal-body").html('<ul class="bxslider"></ul>');
$(".bxslider").append(result);
$('.bxslider').bxSlider();
},
complete: function (result) {
$(window).trigger('resize');
}
});
$(document).on('click',function(){
$('.collapse').collapse('hide');
})
$(document).on('click',function(){
$('.collapse').collapse('hide');
})
答案 1 :(得分:1)
使用此
$(document).on('click',function(){ $('.collapse').collapse('hide'); })