pojmuję już powoli budowę i działanie widgetow. ale za cholerę nie mogę wywołać InfoButtona po najechaniu na widget :/ Piszę wszystko w edytorze, dashcode nie jest dla mnie rozwiązaniem.
W skrypcie JS mam:
var InfoButton; var DoneButton; function setup() { DoneButton = new AppleGlassButton(document.getElementById("doneButton"), "Done", hidePrefs); InfoButton = new AppleInfoButton(document.getElementById("infoButton"), document.getElementById("front"), "white", "white", showPrefs); } function showPrefs() { var front = document.getElementById("front"); var back = document.getElementById("back"); if (window.widget) widget.prepareForTransition("ToBack"); // freezes the widget so that you can change it without the user noticing front.style.display="none"; // hide the front back.style.display="block"; // show the back if (window.widget) setTimeout ('widget.performTransition();', 0); // and flip the widget over } function hidePrefs() { var front = document.getElementById("front"); var back = document.getElementById("back"); if (window.widget) widget.prepareForTransition("ToFront"); // freezes the widget and prepares it for the flip back to the front back.style.display="none"; // hide the back front.style.display="block"; // show the front if (window.widget) setTimeout ('widget.performTransition();', 0); // and flip the widget back to the front scrollArea.refresh() }
W pliku html widgeta przy body mam wywołanie po załadowaniu hidePref oraz setup. Mimo to nie chce wyświetlać InfoButtona po najechaniu. Powiem dodatkowo, że oczywiście mam diva o id=infoButton w divie id=front, a dla samego infoButtona mam styl (czyli pozycja). Proszę o pomoc doświadczonych widgetowiczów