Sorry Guys, but i really have a problem with understanding how i can get access to the current page.
I want JQM to change a style by clicking an element. (clicking ALWAYS the element in the ACTIVE PAGE, cause i am not interested in previous or next pages)
First of all i fire this:
- $(document).on("pagecontainershow", function() {
- loadClickEvent();
- });
So, this should load the Click event on every page that occurs...
This is the related function:
- function loadClickEvent() {
- // only way to get the active page?!
- var $page = $(":mobile-pagecontainer").pagecontainer("getActivePage");
-
- // buttonX should change CSS every time its clicked in the ACTIVE PAGE
- $page.find("#buttonX").click(function() {
- $("#fixed-screen").css("display", "block");
- });
- }
But this code makes the CSS-change only ONE TIME... so it is working actual. but when i click this #buttonX AGAIN (on the SAME, CURRENT, ACTIVE PAGE), nothing happens. it is not changing again, i dont now why.
I tried many version of this function, like only
$("#buttonX") instead of
$page.find("#buttonX"), or
$page.find
("#fixed-screen"). instead of
$("#fixed-screen")... or even getting the (
getActivePage) again in the click-funtion (line 7)... nothing works.
I ask myself, why is it so hard to just access elements in the active page with JQM? I make bug projects, and i always need this so often, but i never need to get access to next or previous pages, so why is this active-page-access so hard to get?
You know, i come from Mootools, and i just want the function
loadClickEvent to make the button
buttonX changing this CSS EVERY time i click it (on the ACTIVE PAGE).
Please help me, thanks