AppFrameWork (jqmobi) 3.0 settings

Source: Internet
Author: User

1. rewrite the data-load data-unload event ;

In the random JS file to add the code;

functiondispatchpanelevent (fnc,mypanel) {if(typeofFNC = = = "string" &&WINDOW[FNC]) {        returnWINDOW[FNC] (Mypanel); }    Else if(Fnc.indexof (".")! ==-1){        varScope=window,items=fnc.split ("."), len=items.length,i=0;  for(i;i<len-1;i++) {Scope=Scope[items[i]]; if(scope===undefined)return; }        returnScope[items[i]] (Mypanel); }}$ (document). On ("Panelload",function(e) {varhasload=$ (E.target). attr ("Data-load"); returndispatchpanelevent (Hasload,e.target);}) $ (document). On ("Panelunload",function(e) {varhasload=$ (E.target). attr ("Data-unload"); returndispatchpanelevent (Hasload,e.target);})

This allows the data-load= ' test ' to be added to the panel's Div;
The following panel

<class= "Panel"  ID= "Plugins"  data-title= " Plugins "  data-unloaddata-load= ' tests '>

which

function Test () {    alert (' ddddd ');} function Tests () {    alert (' xxxxx ');}

2. data-tab= "Settings" does not work;

 <Divclass= "Panel"ID= "Changetab"Data-tab= "Settings">Changetab</Div>        <Footer>            <ahref= "#mainPage"class= "icon Home"data-transition= "MainPage"ID= "Settings">Main</a>            <ahref= "#onePage"class= "icon HTML5"data-transition= "Slide">Onepage</a>            <ahref= "#twoPage"class= "icon Trash"data-transition= "Up-reveal">Twopage</a>            <ahref= "#threePage"class= "icon Trash"data-transition= "Up-reveal">Threepage</a>        </Footer>

When jumping to changetab this panel footer the bottom should be the ID settings this highlight, but it is not highlighted;
By modifying the SetActiveTab function inside the af.ui.js;

SetActiveTab:function(Ele,view) {varHash; if(typeof(ele)!== "string") Hash=$ (ele). attr ("Data-tab"); View.find ("Footer"). Find ("a"). Removeclass ("pressed"). attr ("data-ignore-pressed", "true"). Filter ("[id= '" "+hash+"] "). AddClass ("pressed"); //var hash;            //if (typeof (Ele)!== "string")            //hash=$ (ele). Prop ("id");            //hash= "#" +hash;            //view.find ("Footer"). Find ("a"). Removeclass ("pressed"). "Attr" ("data-ignore-pressed", "true"). Filter ("[href= '" + hash+ "']"). AddClass ("pressed");},

AppFrameWork (jqmobi) 3.0 settings

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.