Does nothing when trying to open popup

0

No HTML

I have this footer :

<div data-role="footer" data-position="fixed" data-theme="c" data-tap-toogle="false">
            <div data-role="navbar" data-grid="c">
                    <ul>
                       <li><a class = "nav" href="#" id="btnCl">1</a></li>
                       <li><a class = "ui-btn-active  nav" href="#">2</a></li>
                       <li><a class = "nav" href="#" >3</a></li>
                       <li><a class = "nav" href="#" id="btnDef">4</a></li>
                    </ul>
            </div>
</div>

And I created this popup :

<div data-role="popup" id="popupMenu" data-theme="b">
        <ul data-role="listview" data-inset="true" style="min-width:210px;">
            <li><a href="#">A</a></li>
            <li><a href="#">B</a></li>
            <li><a href="#">C</a></li>
            <li><a href="#">D</a></li>
        </ul>
    </div>

And I created in the JavaScript page this function that should, when you click on tab 1 from footer open popup :

$('#btnCl').click(function () {
        $("#popupMenu").popup("open");
    });

Problem:

When you click on tab 1 of footer nothing happens ...

    
asked by anonymous 06.07.2015 / 17:55

1 answer

0

jQuery Mobile Popups

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script><scriptsrc="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>

<a href="#popupBasic" data-rel="popup" class="ui-btn ui-corner-all ui-shadow ui-btn-inline" data-transition="pop">Basic Popup</a>
<div data-role="popup" id="popupBasic">
<p>This is a completely basic popup, no options set.</p>
</div>

Project website: link

Do not forget to always link jQuery Mobile addresses. Just choose your template and adapt the html tags, click View Source

For popups

Use this javascript function

<script type="text/javascript">
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
</script>

In the a href link use onClick="MM_openBrWindow('http://google.com','popup1','scrollbars=yes,resizable=yes,width=500,height=500')"

Result

In this example the popup opens when you click on link 1
link

Possible Attributes

* This example is like google.com to display Popup 1: window name, called javascript
Scrollbars:

06.07.2015 / 18:32