azicchetti / jquerymobile-router

A router/controller for jquery mobile. Also adds support for client-side parameters in the hash part of the url. The routes handles regexp based routes. This plugin can be used alone or (better) with Backbone.js or Spine.js, because it's originally meant to replace their router with something integrated with jQM.
GNU General Public License v2.0
402 stars 69 forks source link

Same page example #54

Closed scruffian closed 12 years ago

scruffian commented 12 years ago

Hi

I am trying to change the content of my page based on passing some parameters to the router. I have been looking at the same page example, but I am having a couple of problems:

  1. I want to stop the default animation, so that the page doesn't fade in/out.
  2. The page seems to lose its active state on the second time I navigate to it.

I wonder if I am doing this the wrong way?

Thanks Ben

azicchetti commented 12 years ago

Hi, in order to stop the default animation, the anchor you're using to link the page should contain the data-transition="none" attribute.

For example:

<a href="#yourpage?param=value2&param2=value2" data-transition="none">yourpage</a>

I'm afraid I don't get the second question, what do you mean for losing the active state? Something related to the ui-btn-active class of navbar buttons?

scruffian commented 12 years ago

brilliant, thank you. how stupid of me to have not realised! the other problem is fixed now with this too...