$(window).on('click', '.propClone a', function() {
$(this).parents('.navbar-collapse').addClass('collapse')
});
$('.navbar-collapse').on('click', 'a', function (e) {
$(e.delegateTarget).collapse('toggle');
});
$(function(){
$('.navbar-collapse').on('click', 'a', function (e) {
$(e.delegateTarget).collapse('toggle');
});
});
$('a[href*=#section]').click(function() {
if (location.pathname.replace(/^\//,'') === this.pathname.replace(/^\//,'') && location.hostname === this.hostname) {
var $target = $(this.hash);
$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
if ($target.length) {
var targetOffset = $target.offset().top;
$('html,body').animate({scrollTop: targetOffset}, 1000);
return false;
}
}
});
$('a[href*=#section]').click(function(event) {
event.preventDefault();
if (location.pathname.replace(/^\//,'') === this.pathname.replace(/^\//,'') && location.hostname === this.hostname) {
var $target = $(this.hash);
$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
if ($target.length) {
var targetOffset = $target.offset().top;
$('html,body').animate({scrollTop: targetOffset}, 1000);
}
}
});
function convert(arr) {
for(var k = 0, newArr = []; k < arr.length; k++ ){
newArr.push(arr[k].Lattitude+';'+arr[k].Longitude);
}
return newArr;
}
function diff(arr1, arr2) {
var tmpArr1 = convert(arr1),
tmpArr2 = convert(arr2),
result = [];
for(var i = 0; i < arr1.length; i++){
if(tmpArr2.indexOf(tmpArr1[i]) == -1) {
result.push(arr1[i])
}
}
return result;
}
arr1 = [
{Lattitude: '52,4043000', Location: 'a2', Longitude: '55,7181815'},
{Lattitude: '52,3882320', Location: 'b2', Longitude: '55,7225500'},
{Lattitude: '52,4041184', Location: 'c2', Longitude: '55,7172296'},
{Lattitude: '52,3996194', Location: 'd2', Longitude: '55,7200249'},
{Lattitude: '52,3996194', Location: 'd2', Longitude: '55,7200240'},
];
arr2 = [
{Lattitude: '52,3882320', Location: 'b2', Longitude: '55,7225500'},
{Lattitude: '52,4041184', Location: 'c2', Longitude: '55,7172296'},
{Lattitude: '52,3996194', Location: 'd2', Longitude: '55,7200249'}
];
console.log(diff(arr1, arr2))
$('tr td', '#myid')
.slice(1)
.first() // or .eq(0)
.css({color: 'red'})
.end() // вернуться выбранной коллекции
.eq(1)
.css({color: 'green'})
.end().end() // вернуться к первоначальному набору
.first()
.css({color: 'yellow'})