【小编推荐】appframework手册-简介

2014-07-07   |   发布者:梁国芳   |   查看:3320次

app开发
 

Quickstart

When using App Framework, you can only use W3C valid selectors. To see the full list, go to W3C . We do not support the custom psuedo selectors that jQuery* has created. Below are some examples of how App Framework can help speed up your development.

First, include App Framework into your page.

1
<script src="//cdn.app-framework-software.intel.com/2.1/appframework.min.js" type="text/javascript"></script>
App Framework works by adding elements into a "bucket". All elements inside the bucket have access to the special App Framework api functions that help speed up your development.

To use App Framework, you first call the $() function with a parameter. The parameter can be one of the following.
  1. String - this could be an element id "#id", classname ".foo", a combination "#id .foo", or an HTML string to create an object "<div id='foo'></div>"
  2. Element - This will create a new App Framework object and add the element to the bucket.
  3. Array/Object - this will create a new App Framework object and add the items to the bucket.
  4. Function - this will execute a function when DOMContentLoaded has triggered, or immediatly after the case
You can also pass an addtional parameter "Context" that allows you to search/filter within that.

Below are some basic samples of finding elements.

1
2
3
4
5
6
7
$("#foo"); //find the element with id="foo";
 
$("div"); //Find all the divs on the page;
 
$(".foo"); //Find all elements that have the classname ="foo";
 
$(