Skip to content Skip to navigation

Connexions

You are here: Home » Content » jQuery Mobile - Strukturering af sider

Navigation

Recently Viewed

This feature requires Javascript to be enabled.
 

jQuery Mobile - Strukturering af sider

Module by: Mick Lyngø. E-mail the author

Summary: Dette modul introducere til strukturering af sider i jQuery Mobile.

Introduktion

Når sider skal struktureres i jQuery Mobile er det naturligvis væsentligt at have for øje at struktur og standard skal have konsistens. Det er altså vigtigt at strukturen afspejler at indholdet skal bruges på en mobilenhed, hvilket i sagens natur, både har styrker og svagheder.

Kolonner

Kolonner er i mange tilfælde ikke en god løs, når det kommer til brug på mobileenheder, fordi kolonnebredden typisk er en udfordring for den mobile enhed. Alligevel kan der være tilfælde, hvor brugen af kolonner alligevel er nødvendig. I dette eksempel vises et eksempel på, hvordan der udarbejdes en 2 x 1 kolonne.

<div id="fs-id1168018077308" class="ui-grid-a"> <div id="fs-id1168002938576" class="ui-block-a"><strong>I'm Block A</strong> and text inside will wrap</div> <div id="fs-id1168018086627" class="ui-block-b"><strong>I'm Block B</strong> and text inside will wrap</div> </div><!-- /grid-a -->

Folde-sammen-og-rulle-ud-menu

Idet indholdet på siden skal være tilpasset mobile enheder kan det være en god idé umiddelbart at skjule indhold for modtageren for at bevare overskueligheden. En af måderne at gøre det på er via en rullemenu, som brugeren kan klikke på for at synliggøre nyt indhold. Den kan laves med nedenstående kode:

<div data-role="collapsible"> <h3>I'm a header</h3> <p>I'm the collapsible content. By default I'm closed, but you can click the header to open me.</p> </div>

Du kan også lave en menu, som automatisk folder ud når siden er indlæst. Det gør du ved hjælp af tilføje attributen:

> <div data-role="collapsible" data-collapsed="false">

Content actions

Download module as:

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Add module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks