twbs / ratchet

Build mobile apps with simple HTML, CSS, and JavaScript components.
http://goratchet.com
MIT License
14.61k stars 1.45k forks source link

Problem with several push #635

Open matiasmancilla opened 10 years ago

matiasmancilla commented 10 years ago

I use the Title bar with segmented control with 4 control item,

<div class="segmented-control">
        <a class="control-item active" onclick="myFuncion()">page 1</a>
        <a class="control-item" onclick="myFuncion2()" >page 2</a>
        <a class="control-item" onclick="myFuncion3()" >page 3</a>
        <a class="control-item" onclick="myFuncion4()"  >page4</a>
      </div>

and each control item has a onclick event to a js function (see code below) .

    function myFuncion()
    {
     PUSH({url: "pages/Page1.html",  transition: 'slideIn' });
    }

      function myFuncion2()
    {
     PUSH({url: "pages/Page2.html",  transition: 'slideIn' });
    }

     function myFuncion3()
    {
     PUSH({url: "pages/Page3.html",  transition: 'slideIn' });
    }

     function myFuncion4()
    {
     PUSH({url: "pages/Page4.html",  transition: 'slideIn' });
    }

The problem is: I can see the change of page in the first 2 push (no matter what page i clicked, the change occurs) , but after that, nothing happens in the clicks of the control-item. Whats going on? is related with cache push? what can i do?

Thank you Matias

yubiaobin commented 10 years ago

try with function myFunction(){ PUSH({url : "pages/Page1.html", transition : "slide-in" }); }

and so on

trevor403 commented 8 years ago

I did not know that the PUSH function was exposed and this was a huge help, I almost went to an alternative because I didn't know how to expose push.js functions.