facebook

Function sample()

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #350509 Reply

    Nie Que
    Member

    Hi, Im using mobiOne for my application. I have this function and it work well when i put it ON THE PAGE CHANGE. so i put it on my sample_custom.js and the activepage() function ON THE PAGE CHANGE but it wont work anymore. \\

    Is there somebody who could help me with this. any reply would be appreciated. thank you

    function activepage()
    {
    var activePage = $(newPage).attr(‘id’);

    if (activePage == ‘m1-TacticalAsia-Cart’) {
    alert(activePage);
    }else if(activePage == ‘m1-TacticalAsia-Home’) {

    alert(activePage);//some other code
    changeImage();
    }
    else
    {
    alert(‘do nothing’);
    }
    }

    #350517 Reply

    Code_A
    Member

    You would need to write a separate function to accept the page id as an argument. The newPage/oldPage as your are using them are local to the multipage widget.

    function within _custom.js

    function myPage (activePage) {
     //place conditional code here
    }

    code within multipage widget JS window

    myPage ($(newPage).attr('id'));

    I did not test this code, I just typed it up quickly to give you an idea on how to proceed.

    #350531 Reply

    Nie Que
    Member

    it work.

    thank you so much code A.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Function sample()

You must be logged in to post in the forum log in