vuler,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
.orange {
background: #FFCC00;
}
.orange + div{
display: block;
}
span {
cursor: pointer;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>
jQuery.fn.hide_by_click = (function() {
var arrSelector = [];
$(document).on('click', function(event) {
$.map(arrSelector, function(el) {
if (event.target != el && !$(el).has(event.target).length) $(el).fadeOut()
})
});
return function(add) {
this.each(function(indx, el) {
if (add) arrSelector.push(el);
else {
var indx = $.inArray(el, arrSelector);
if (indx != -1) arrSelector.splice(indx, 1)
}
});
return this
}
}())
$(function() {
$(".block_info_main span").hide_by_click(true); //добавить все span для контроля
$(".orange").hide_by_click(false); // убрать оранжевый из списка слежения
});
</script>
</head>
<body>
<div class='block_info_main' id='test'>1111
<div class='first'>
<span class='info orange'>Информация</span>
<div class='main'>
<span class='info_show show '>текст1</span>
</div>
</div>
<div class='first'>
<span class='info'>Информация2</span>
<div class='main'>
<span class='info_show '><b style="color: rgb(51, 51, 255)">текст2</b></span>
</div>
</div>
<div class='first'>
<span class='info'>Информация3</span>
<div class='main'>
<span class='info_show '>текст3</span>
</div>
</div>
</div>
</body>
</html>