Uganda Under-19s vs Tanzania Under-19s ICC Under-19 Men's World Cup Africa Qualifier Live Scorecard Commentary

'; } for (var t = 0; t < innings_bowler[s.options[i].value].length; t++) { htmlbowl += ''; //htmlbowldiv += '

' + innings_bowler[s.options[i].value][t] + '

'; } prntdiv = $('.innings_highlights').parent('div.custom-select').parent('div.filter_inner'); prntdiv.find('.innings_batsmen').html(htmlbat); //prntdiv.find('.inning_bat .select-items').addClass('select-hide'); //prntdiv.find('.inning_bat .select-items').html(htmlbatdiv); prntdiv.find('.innings_bowlers').html(htmlbowl); //prntdiv.find('.inning_bowl .select-items').addClass('select-hide'); //prntdiv.find('.inning_bowl .select-items').html(htmlbowldiv); if (clik != undefined && clik != '') { prntdiv.find('.inning_bat .select-items, .inning_bat .select-selected').remove(); setSelectUI(document.getElementsByClassName("inning_bat")); document.addEventListener("click", closeAllSelect); prntdiv.find('.inning_bowl .select-items, .inning_bowl .select-selected').remove(); setSelectUI(document.getElementsByClassName("inning_bowl")); document.addEventListener("click", closeAllSelect); } } customSelectEvents(document.getElementsByClassName('country_innings')[0], 1, ''); function customSelectEvents(s, i, clik) { if (s.classList.toString().match('country')) { $('.commentary').hide(1); $('.commentary').eq(s.options[i].value).show(1); $('.comment_overend,.comment').show(1); resetSelect(s, i, clik); } if (s.classList.toString().match('highlight') && clik != undefined && clik != '') { var slectd = $('.country_innings').val(); if (s.options[i].value.match('select')) { $('.commentary:eq(' + slectd + ')').find('.comment_overend,.comment').hide(1); $('.commentary:eq(' + slectd + ')').find('.' + s.options[i].value).show(1); } else { $('.commentary:eq(' + slectd + ')').find('.comment_overend,.comment').show(1); } } if (s.classList.toString().match('batsmen') && clik != undefined && clik != '') { var slectd = $('.country_innings').val(); if (s.options[i].value != '1') { $('.commentary:eq(' + slectd + ')').find('.comment_overend,.comment').hide(1); $('.commentary:eq(' + slectd + ')').find(":contains(" + s.options[i].value + ")").not('.comment_overend').show(1); } else { $('.commentary:eq(' + slectd + ')').find('.comment_overend,.comment').show(1); } } if (s.classList.toString().match('bowlers') && clik != undefined && clik != '') { var slectd = $('.country_innings').val(); if (s.options[i].value != '1') { $('.commentary:eq(' + slectd + ')').find('.comment_overend,.comment').hide(1); $('.commentary:eq(' + slectd + ')').find(":contains(" + s.options[i].value + ")").not('.comment_overend').show(1); } else { $('.commentary:eq(' + slectd + ')').find('.comment_overend,.comment').show(1); } } } function setSelectUI(classReset) { var x, i, j, l, ll, selElmnt, a, b, c; /*look for any elements with the class "custom-select":*/ if (classReset == '') { x = document.getElementsByClassName("custom-select"); } else { x = classReset; } l = x.length; for (i = 0; i < l; i++) { selElmnt = x[i].getElementsByTagName("select")[0]; ll = selElmnt.length; /*for each element, create a new DIV that will act as the selected item:*/ if (selElmnt.options[selElmnt.selectedIndex] != undefined && selElmnt.options[selElmnt.selectedIndex] != '') { a = document.createElement("DIV"); a.setAttribute("class", "select-selected"); a.setAttribute("id", selElmnt.classList); a.innerHTML = selElmnt.options[selElmnt.selectedIndex].innerHTML; x[i].appendChild(a); /*for each element, create a new DIV that will contain the option list:*/ b = document.createElement("DIV"); b.setAttribute("class", "select-items select-hide"); for (j = 1; j < ll; j++) { /*for each option in the original select element, create a new DIV that will act as an option item:*/ c = document.createElement("DIV"); c.innerHTML = selElmnt.options[j].innerHTML; c.addEventListener("click", function (e) { /*when an item is clicked, update the original select box, and the selected item:*/ var y, i, k, s, h, sl, yl; s = this.parentNode.parentNode.getElementsByTagName("select")[0]; sl = s.length; h = this.parentNode.previousSibling; for (i = 0; i < sl; i++) { if (s.options[i].innerHTML == this.innerHTML) { s.selectedIndex = i; h.innerHTML = this.innerHTML; y = this.parentNode.getElementsByClassName("same-as-selected"); yl = y.length; for (k = 0; k < yl; k++) { y[k].removeAttribute("class"); } this.setAttribute("class", "same-as-selected"); s.options[i].selected = 'selected'; s.value = s.options[i].value; customSelectEvents(s, i, 'click'); break; } } h.click(); }); b.appendChild(c); customSelectEvents(selElmnt, j); } x[i].appendChild(b); a.addEventListener("click", function (e) { /*when the select box is clicked, close any other select boxes, and open/close the current select box:*/ e.stopPropagation(); closeAllSelect(this); this.nextSibling.classList.toggle("select-hide"); this.classList.toggle("select-arrow-active"); }); } } } function closeAllSelect(elmnt) { /*a function that will close all select boxes in the document, except the current select box:*/ var x, y, i, xl, yl, arrNo = []; x = document.getElementsByClassName("select-items"); y = document.getElementsByClassName("select-selected"); xl = x.length; yl = y.length; for (i = 0; i < yl; i++) { if (elmnt == y[i]) { arrNo.push(i) } else { y[i].classList.remove("select-arrow-active"); } } for (i = 0; i < xl; i++) { if (arrNo.indexOf(i)) { x[i].classList.add("select-hide"); } } } /*if the user clicks anywhere outside the select box, then close all select boxes:*/ document.addEventListener("click", closeAllSelect); setSelectUI('');

You Might Also Like