I have a pages variable
pages = $("[data-role=page]:not([data-url])");
which the
[ <div data-role=β"page" id=β"home" class=β"home ui-page ui-body-c" tabindex=β"0" style=β"min-height:β 548px;β">ββ¦β</div>β , <div data-role=β"page" id=β"login" class=β"login ui-page ui-body-c ui-page-active" tabindex=β"0" style>ββ¦β</div>β ]
But when I use pages.index(".ui-page-active") , I get -1 - the wrong result.
However, when I search for pages.index(".ui-page") , I get 1 - the correct result.
Any ideas?
UPDATE:
pages.index( $('.ui-page-active') ) returns 1 - the correct result! But why does the option not work?
source share