objectivehtml / FlipClock

http://flipclockjs.com/
MIT License
2.74k stars 954 forks source link

Many instances not working in FireFox #212

Closed SamehSaeed closed 9 years ago

SamehSaeed commented 9 years ago

Hello, I'm working on a project that need to create many instance of flip clock with face "Counter" on each row, in about 18 rows so I created an array to put the instances in it, that works perfectly on all browsers except "Fire Fox".

Look to the third highlighted column the first & second is fixed just html elements take the CSS Classes for design.

Code:

    var flipArr = [];
    var rowsArr = [];
    var selectedRow = 0;

    $(document).ready(function () {
        var tempRowsObjArr = $(".rowUpdatedContent");
        //debugger;
        for (i = 0 ; i < (tempRowsObjArr.length) ; i++) {
            var divs = $(tempRowsObjArr[i]).find("div.filpNum").each(function () {
                var value = this.innerText;
                var temp = new FlipClock($(this), value, {
                    clockFace: 'Counter',
                    minimumDigits: 3
                });
                flipArr.push(temp);
            });
            rowsArr.push($(divs[0].parentNode.parentNode));
        }

        console.log(flipArr);
        console.log(rowsArr);

    });

FireFox

untitled20150613152106

All Other Browsers

untitled20150613154420

SamehSaeed commented 9 years ago

I understood the issue, here it is "this.innerText" not working with firefox, it must be like that

    for (i = 0 ; i < (tempRowsObjArr.length) ; i++) {
        var divs = $(tempRowsObjArr[i]).find("div.filpNum").each(function () {
        var value = (this.innerText) ? this.innerText : this.innerHTML;
        var temp = new FlipClock($(this), value, {
                clockFace: 'Counter',
                minimumDigits: 3
            });
            flipArr.push(temp);
        });