23.01.2018 Views

MICROSOFT_PRESS_EBOOK_PROGRAMMING_WINDOWS_8_APPS_WITH_HTML_CSS_AND_JAVASCRIPT_PDF

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Some Tips and Tricks<br />

• In the current implementation, tooltips on a slider () are always numerical<br />

values; there isn’t a means to display other forms of text, such as Low, Medium, and High. For<br />

something like this, you could consider a WinJS.UI.Rating control with three values, using the<br />

tooltipStrings property to customize the tooltips.<br />

• The ::-ms-tooltip pseudo-selector for the slider affects only visibility (with display: none); it<br />

cannot be used to style the tooltip generally. This is useful to hide the default tooltips if you want<br />

to implement custom UI of your own.<br />

• There are additional types of input controls (different values for the type attribute) that I haven’t<br />

mentioned. This is because those types have no special behaviors and just render as a text box.<br />

Those that have been specifically identified might also just render as a text box, but they can<br />

affect, for example, what on-screen keyboard configuration is displayed on a touch device (see<br />

Chapter 9) and also provide specific input validation (e.g., the number type only accepts digits).<br />

• The WinJS attribute, data-win-selectable, when set to true, specifies that an element is<br />

selectable in the same way that all input and contenteditable elements are.<br />

• If you don’t find width and height properties working for a control, try using style.width and<br />

style.height instead.<br />

• You’ll notice that there are two kinds of button controls: and .<br />

They’re visually the same, but the former is a block tag and can display <strong>HTML</strong> inside itself,<br />

whereas the latter is an inline tag that displays only text. A button also defaults to , which has its own semantics, so you generally want to use to be sure.<br />

158

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!