public/javascripts/yui/carousel/carousel-debug.js
function () {
            var carousel = this,
                css      = carousel.CLASSES,
                cur      = carousel._pages.cur, // current page
                el,
                i,
                item,
                n        = carousel.get("numVisible"),
                num      = carousel._pages.num, // total pages
                pager    = carousel._pages.el,  // the pager container element
                sel;

            if (num === 0) {
                return;// don't do anything if number of pages is 0
            }

            sel = document.createElement("SELECT");


            if (!sel) {
                YAHOO.log("Unable to create the pager menu", "error",
                          WidgetName);
                return;
            }

            // Hide the pager before redrawing it
            Dom.setStyle(pager, "visibility", "hidden");

            // Remove all nodes from the pager
            while (pager.firstChild) {
                pager.removeChild(pager.firstChild);
            }

            for (i = 0; i < num; i++) {

                el   = document.createElement("OPTION");
                el.value     = i+1;
                el.innerHTML = carousel.STRINGS.PAGER_PREFIX_TEXT+" "+(i+1);

                if (i == cur) {
                    el.setAttribute("selected", "selected");
                }

                sel.appendChild(el);
            }

            el = document.createElement("FORM");
            if (!el) {
                YAHOO.log("Unable to create the pager menu", "error",
                          WidgetName);
            } else {
                el.appendChild(sel);
                pager.appendChild(el);
            }

            // Show the pager now
            Event.addListener(sel, "change", carousel._pagerChangeHandler, this, true);
            Dom.setStyle(pager, "visibility", "visible");
        }
function () {
            var carousel = this,
                css      = carousel.CLASSES,
                cur      = carousel._pages.cur, // current page
                el,
                i,
                item,
                n        = carousel.get("numVisible"),
                num      = carousel._pages.num, // total pages
                pager    = carousel._pages.el,  // the pager container element
                sel;

            if (num === 0) {
                return;// don't do anything if number of pages is 0
            }

            sel = document.createElement("SELECT");


            if (!sel) {
                YAHOO.log("Unable to create the pager menu", "error",
                          WidgetName);
                return;
            }

            // Hide the pager before redrawing it
            Dom.setStyle(pager, "visibility", "hidden");

            // Remove all nodes from the pager
            while (pager.firstChild) {
                pager.removeChild(pager.firstChild);
            }

            for (i = 0; i < num; i++) {

                el   = document.createElement("OPTION");
                el.value     = i+1;
                el.innerHTML = carousel.STRINGS.PAGER_PREFIX_TEXT+" "+(i+1);

                if (i == cur) {
                    el.setAttribute("selected", "selected");
                }

                sel.appendChild(el);
            }

            el = document.createElement("FORM");
            if (!el) {
                YAHOO.log("Unable to create the pager menu", "error",
                          WidgetName);
            } else {
                el.appendChild(sel);
                pager.appendChild(el);
            }

            // Show the pager now
            Event.addListener(sel, "change", carousel._pagerChangeHandler, this, true);
            Dom.setStyle(pager, "visibility", "visible");
        }
function ( ) { var carousel = this , css = carousel . CLASSES , cur = carousel . _pages . cur , // current page el , i , item , n = carousel . get ( "numVisible" ) , num = carousel . _pages . num , // total pages pager = carousel . _pages . el , // the pager container element sel ; if ( num === 0 ) { return ; // don't do anything if number of pages is 0 } sel = document . createElement ( "SELECT" ) ; if ( ! sel ) { YAHOO . log ( "Unable to create the pager menu" , "error" , WidgetName ) ; return ; } // Hide the pager before redrawing it Dom . setStyle ( pager , "visibility" , "hidden" ) ; // Remove all nodes from the pager while ( pager . firstChild ) { pager . removeChild ( pager . firstChild ) ; } for ( i = 0 ; i < num ; i ++ ) { el = document . createElement ( "OPTION" ) ; el . value = i + 1 ; el . innerHTML = carousel . STRINGS . PAGER_PREFIX_TEXT + " " + ( i + 1 ) ; if ( i == cur ) { el . setAttribute ( "selected" , "selected" ) ; } sel . appendChild ( el ) ; } el = document . createElement ( "FORM" ) ; if ( ! el ) { YAHOO . log ( "Unable to create the pager menu" , "error" , WidgetName ) ; } else { el . appendChild ( sel ) ; pager . appendChild ( el ) ; } // Show the pager now Event . addListener ( sel , "change" , carousel . _pagerChangeHandler , this , true ) ; Dom . setStyle ( pager , "visibility" , "visible" ) ; }
Update the UI for the pager menu based on the current page and
the number of pages.  If the number of pages is greater than
MAX_PAGER_BUTTONS, then the selection of pages is provided by a drop
down menu instead of a set of buttons.

@method _updatePagerMenu
@protected
Update the UI for the pager menu based on the current page and the number of pages . If the number of pages is greater than MAX_PAGER_BUTTONS then the selection of pages is provided by a drop down menu instead of a set of buttons .