Created
May 18, 2014 17:03
-
-
Save A-gambit/a8945d5c80c913994ec7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ДО | |
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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