Firstly, I don't want to cause any naming confusion. I'm referring to the animated spinners you often see on sites that indicate you need to wait a few secs while the page is doing something (you know ... "Please Wait - Loading" with a little circular animated GIF icon). I am NOT referring to the pending 1.9 spinner/stepper control :)
I'm calling it an "animated spinner" as that is what I think JQ call it on one of their pages (in the dialog section from memory).
Anyway, sorry to digress ... my question is this: Is there an animated spinner UI? I cannot seem to find one. The dialog UI might lend itself to such a purpose, but I'd really like to use a purpose-built UI for this.
The UI should allow me to control the size of the background rectangle (either full screen or a certain size), it's opacity, rounded or square corners, location on screen (fixed or auto centered vertically and/or horizontally), and perhaps the ability to select from various animated spinner styles.
If there is a plugin that exists to perform this function then please let me know as the plugin section of the JQ website is down at the moment.
The following issue has had me stumped for days. No matter how much I read and how much I try various things I cannot seem to get past this simple pageChange() problem.
I've stripped back my code to this template that reproduces the problem. I've tested on iPhone4, iPad2 and FF6 and Chrome - all produce the exact same error.
I am trying to get a handle on what event code to place where in the DOM firing sequence.
Here's some very basic code I've written to test one idea - that being to "jump" to a different div "page" than the 1st one in the list. Yes, I know I could use [class="ui-page-active"] within the [data-role="page"] div, but for the sake of this exercise I wanted to use $.mobile.changePage().
// document.ready is fired *after* the page has loaded
$(document).ready(function () {
if (debug) alert("$(document).ready() triggered");
$.mobile.changePage("#page2");
});
</script>
</head>
<body>
<div data-role="page" id="page1">
<div data-role="header">
<h1>Page1 Header</h1>
</div>
<div data-role="content">
<a href="#page2">go to index.html#page2</a>
</div>
<div data-role="footer">
<h2>Page1 Footer</h2>
</div>
</div>
<div data-role="page" id="page2">
<div data-role="header">
<h1>Page2 Header</h1>
</div>
<div data-role="content">
<a href="#page1">go to index.html#page1</a>
</div>
<div data-role="footer">
<h2>Page2 Footer</h2>
</div>
</div>
</body>
</html>
As you can see I've:
a) inserted a javascript block with a global variable to control the alerts() ... it's in a separate js block for aesthetics only, so please don't critique me on code style :) I just want to clearly show the placement of js blocks in the jQuery/JQM flow of things.
b) a js block *before* the JQM js (necessary for mobileinit - but I don't yet know what else should go in at this point - hence why I'm trying to build this trigger-alert style framework that I'm hoping others will help flesh out).
c) a document.ready() function that is fired once the page is fully loaded (is fired when the "internal" page is loaded - as far as I know links to external resources like images etc happen after the document.ready() function. For example, if I had a reference in my content block to say http://someotherdomain.com/img.gif, document.ready() fires before these external links have been loaded.
Now, for this test, I want to jump to an internal page out-of-sequence (ie. #page2). So I've used $.mobile.changePage("#page2"); inside the document.ready() event.
Ok, so the jump occurs ok.
Of course it occurs to me that I should put this jump code into the page1.pagebeforecreate() event as we don't really want any page displayed yet until I've jumped to the page I want displayed. But does "jumping" out of the beginning of a page creation (and therefore all subsequent events, like pagecreate() and pageinit(), won't be triggered) cause any issues re: the DOM being in an "unstable/incomplete state?
I look forward to your thoughts on this topic.
I have ready the RC1 API documentation and don't quite understand all that is said re pageinit, mobileinit, using pageint instead of document.ready() etc etc etc. Lack of clear and concise examples just exascerbates my clouded mind :)
I have a website with a premium SSL installed. Works just fine (ie. normal behaviour - green bar shows up in broswer's address bar when visiting any page using https://, across all desktop browsers I've tested FF7 IE9 Chrme Safari, including my iPhone4 and iPad2 which shows a green padlock and the name of the domain at the top of the Safari browser window).
But if a web page on my domain contains the standard JQM CDN links in the header (http:// not https://), the green bar (on desktops) or the green padlock (in iPhone or iPad) does not show. Therefore I'm presuming that https:// isn't enabled, and more importantly, the visual clue for the user isn't displayed.
Does anyone have a work-around or fix for this?
Happy to send screenshots to anyone if needed for clarification.
If I change these to using https then other issues start to arise (ie. browser prompts to confirm mismatched cert to domain name etc and the JQM page no longer displays correctly as if all html tags have been removed from the document, just leaving text behind).