Skip to content

Instantly share code, notes, and snippets.

@A-gambit
Created May 18, 2014 17:03
Show Gist options
  • Save A-gambit/a8945d5c80c913994ec7 to your computer and use it in GitHub Desktop.
Save A-gambit/a8945d5c80c913994ec7 to your computer and use it in GitHub Desktop.
ДО
if(numBefore!==0){
//перевірка умови існування одного батька у елементів
if(beforeChilde.parentNode===elemBefore[numBefore-1].parentNode){
//перевірка умови існування одного батька
if(afterChilde.parentNode===elem[num-1].parentNode){
return true;
}
else
return false;
}
else
return true;
}
else
return true;
var condition=numBefore===0;
if(condition) return true;
else return checkCocdiiton(beforeChilde, afterChilde);
function checkCocdiiton(beforeChilde, afterChilde){
var anotherCondition=beforeChilde.parentNode===elemBefore[elemBefore.length-1].parentNode;
if(anotherCondition) return nextCondition(beforeChilde, afterChilde);
else return true;
}
function nextCondition(beforeChilde, afterChilde){
var anotherCondition= afterChilde.parentNode===elem[elem.length-1].parentNode;
if(anotherCondition) return true;
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment