Good day! There is such a construction:

<input type="button" class="jqModal" value= "LOGIN" onclick="show()"/> <div class="jqmWindow" id="dialog"> //это должно появляться при клике <jdoc:include type="modules" name="login" /> </div> 

I wrote a handler in the head:

 function show() { var rd = $(".jqmWindow"); rd.style.display = 'block'; } 

Tell me why it does not work? And how to make the window appear when you click on the text or image?

    2 answers 2

    In the example, you have a default div. First you need to hide it :) And if you already use jQuery, then write this:

    html

     <input type="button" class="jqModal" value= "LOGIN"/> <div class="jqmWindow" id="dialog" style="display:none;"> </div> 

    javascript

     $(".jqModal").click (function () { $(".jqmWindow").show(); }); 
    • Thanks It works. - woland
     function show() { var rd = $(".jqmWindow").show(1000); } 

    or

     function show() { var rd = document.getElementById('dialog'); rd.style.display = 'block'; } 

    Not?

    • Does not work. - woland
    • @Alexander Gabaraev, To format the code, select it with the mouse and click on the button 101010 of the editor. - angry