This may be redundant.

Is it possible to include this code in a Javascript tiddler and use it!


var ul = document.getElementsByClassName('incremental');
for (var i = 0; i < ul.length; i++) {
    ul[i].style.listStyleType = 'decimal';


}
var childlists = document.querySelectorAll(".incremental>li");
for (var i = 0; i < childlists.length; i++) {
    childlists[i].style.display = "none";
}
window.onkeydown = function (event) {
    var childlists = document.querySelectorAll(".incremental>li");
    var pos;

    //assigning appropirate value to pos
    for (var i = 0; i < childlists.length; i++) {

        if (childlists[i].style.display == "none") {

            pos = i;
            break;
        } else {
            pos = childlists.length ;
        }


    }
    // check whether pos is in the allowed interval
    // note that allowed interval is length of child array

    if (event.key == "ArrowRight") {

        if (pos<childlists.length) {
            childlists[pos].style.display = ""

        }

    }
    if (event.key == "ArrowLeft") {

        if (pos - 1 >= 0) {

            childlists[pos - 1].style.display = "none";
        }

    }
}



/Mohammad

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/203cfbba-6c39-4e8f-a2ba-a134ca6de307%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to