0

我试图弄清楚当用户单击标题(h3)时如何打开弹出菜单。

(使用 jQuery 1.9.1 和 jQM 1.3.1)

HTML

<div data-role='header' data-theme='b'>
  <h3 data-rel='popup' href='#projectsOpen' id='projectName'>*Untitled</h3>
</div>


<div data-role='popup' id='projectsOpen' data-theme='a' class='ui-corner-all'>
  <ul data-role='listview' id='projectList'>
   <li><input type='radio' id='newproj' checked='checked'/><span>Create New Project</span></li>
   <li><input type='radio' id='project1'/><span id='project1Title'></span></li>
  </ul>
</div>

谁能阐明我如何做到这一点?

4

1 回答 1

1
It seems this fixs your issue..



<div data-role="page" id="p1"> 
      <div data-role='header' data-theme='b'>
      <h3 data-rel='popup' id='projectName'>*Untitled</h3>
    </div>   
    <div data-role='popup' id='projectsOpen' data-theme='a' class='ui-corner-all'>
      <ul data-role='listview' id='projectList'>
       <li><input type='radio' id='newproj' checked='checked'/><span>Create New Project</span></li>
       <li><input type='radio' id='project1'/><span id='project1Title'></span></li>
      </ul>
    </div>
  </div> 



 //jquery   

      $("#projectName").click(function(){
                $("#projectsOpen").popup("open");
        });


 you can observe here

    http://jsfiddle.net/N7Z9e/2254/
于 2013-09-24T06:45:16.173 回答