Another problem with w / jqTouch ... I am trying to determine which item was pressed to trigger an animation so that I can pass parameters from the clicked item to the next page.
My HTML:
<div id="places"> <div class="toolbar"> <h1>Places</h1> <a class="back" href="#">Back</a> </div> <ul> <li id="1"><a href="#singleplace">Place 1</a></li> <li id="2"><a href="#singleplace">Place 2</a></li> <li id="3"><a href="#singleplace">Place 3</a></li> </ul> </div> <div id="singleplace"> <div class="toolbar"> <h1></h1> <a class="back" href="#">Back</a> </div> </div>
When I click on any list item in #places, I can go to #singleplace just fine, but I'm trying to determine which item was clicked so that I can pass parameters to #singleplace cases. My javascript:
var placeID; $('#places a').live('mouseup',function(){ $('#singleplace h1').html($(this).text()) placeID = $(this).parent().attr('id'); })
I tried several alternatives to the $ (el) .live ('event', fn ()) method, including:
$('#places a').live('click',fn()... $('#places a').live('mouseup',fn()... $('#places a').live('tap',fn()... $('#places a').tap(fn()...
None of them work. Is there a better way to handle this? I noticed the following on the jqTouch problems page: http://code.google.com/p/jqtouch/issues/detail?id=91 which may be part of the problem ...
javascript jquery jqtouch
majman
source share