<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to make a completely reusable jquery modal window</title>
	<atom:link href="http://web.enavu.com/tutorials/how-to-make-a-completely-reusable-jquery-modal-window/feed/" rel="self" type="application/rss+xml" />
	<link>http://web.enavu.com/tutorials/how-to-make-a-completely-reusable-jquery-modal-window/</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 18 Jan 2012 08:51:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: MultipleModals?</title>
		<link>http://web.enavu.com/tutorials/how-to-make-a-completely-reusable-jquery-modal-window/comment-page-1/#comment-30747</link>
		<dc:creator>MultipleModals?</dc:creator>
		<pubDate>Wed, 25 May 2011 20:50:46 +0000</pubDate>
		<guid isPermaLink="false">http://tutsvalley.com/?p=223#comment-30747</guid>
		<description>What if I want multiple modals where each modal moves &quot;a step&quot; higher and the mask moves to cover it.  I got it working with hardcoding some info and then &quot;stepping&quot; the z-index 10 points up and down, but I couldn&#039;t come up with a good way to do this dynamically so I could put it on a master page and have all other pages be able to use it.

Any suggestions?

Thanks in advance.</description>
		<content:encoded><![CDATA[<p>What if I want multiple modals where each modal moves &#8220;a step&#8221; higher and the mask moves to cover it.  I got it working with hardcoding some info and then &#8220;stepping&#8221; the z-index 10 points up and down, but I couldn&#8217;t come up with a good way to do this dynamically so I could put it on a master page and have all other pages be able to use it.</p>
<p>Any suggestions?</p>
<p>Thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thiembv</title>
		<link>http://web.enavu.com/tutorials/how-to-make-a-completely-reusable-jquery-modal-window/comment-page-1/#comment-30609</link>
		<dc:creator>thiembv</dc:creator>
		<pubDate>Mon, 23 May 2011 16:22:58 +0000</pubDate>
		<guid isPermaLink="false">http://tutsvalley.com/?p=223#comment-30609</guid>
		<description>Thank you very much. Greats</description>
		<content:encoded><![CDATA[<p>Thank you very much. Greats</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://web.enavu.com/tutorials/how-to-make-a-completely-reusable-jquery-modal-window/comment-page-1/#comment-27724</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Wed, 13 Apr 2011 16:14:01 +0000</pubDate>
		<guid isPermaLink="false">http://tutsvalley.com/?p=223#comment-27724</guid>
		<description>Hey Mick,

You will actually have to take the mask and put it outside the form. The form is positioned relatively so the fixed position of the mask doesn&#039;t work when that happens.</description>
		<content:encoded><![CDATA[<p>Hey Mick,</p>
<p>You will actually have to take the mask and put it outside the form. The form is positioned relatively so the fixed position of the mask doesn&#8217;t work when that happens.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mick</title>
		<link>http://web.enavu.com/tutorials/how-to-make-a-completely-reusable-jquery-modal-window/comment-page-1/#comment-27695</link>
		<dc:creator>mick</dc:creator>
		<pubDate>Wed, 13 Apr 2011 12:22:13 +0000</pubDate>
		<guid isPermaLink="false">http://tutsvalley.com/?p=223#comment-27695</guid>
		<description>Having issue with the mask not filling the whole of the page.  The site is written in VB.net using master template page and everything goes inside a form.

Divs are used to layout the page however I think the stacking order is having an effect on this.

The top and left of the mask is taking the top and left from the main content div and not the actual document if you see what I mean.

I tried another well known solution for overlay modals and got a similar problem because of the staking issues.  This time though it was to do with the mask overlaying everything including the modal box which should be active.

Is there a wy around that I can force the mask to work at form level and not sub division level?

if I put the code within the master templates then it works because the mask are outside the form so they can reference each other.  The form seems to be the big issue here.

Any help is really appreciated.

TIA

Mick</description>
		<content:encoded><![CDATA[<p>Having issue with the mask not filling the whole of the page.  The site is written in VB.net using master template page and everything goes inside a form.</p>
<p>Divs are used to layout the page however I think the stacking order is having an effect on this.</p>
<p>The top and left of the mask is taking the top and left from the main content div and not the actual document if you see what I mean.</p>
<p>I tried another well known solution for overlay modals and got a similar problem because of the staking issues.  This time though it was to do with the mask overlaying everything including the modal box which should be active.</p>
<p>Is there a wy around that I can force the mask to work at form level and not sub division level?</p>
<p>if I put the code within the master templates then it works because the mask are outside the form so they can reference each other.  The form seems to be the big issue here.</p>
<p>Any help is really appreciated.</p>
<p>TIA</p>
<p>Mick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Juuso</title>
		<link>http://web.enavu.com/tutorials/how-to-make-a-completely-reusable-jquery-modal-window/comment-page-1/#comment-23299</link>
		<dc:creator>Juuso</dc:creator>
		<pubDate>Wed, 16 Feb 2011 15:50:35 +0000</pubDate>
		<guid isPermaLink="false">http://tutsvalley.com/?p=223#comment-23299</guid>
		<description>Dude great job! This is awesome, love how you commentated everything! I&#039;m learning jQuery and this is the best for learning!</description>
		<content:encoded><![CDATA[<p>Dude great job! This is awesome, love how you commentated everything! I&#8217;m learning jQuery and this is the best for learning!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://web.enavu.com/tutorials/how-to-make-a-completely-reusable-jquery-modal-window/comment-page-1/#comment-17500</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Wed, 01 Dec 2010 05:31:31 +0000</pubDate>
		<guid isPermaLink="false">http://tutsvalley.com/?p=223#comment-17500</guid>
		<description>Hey John, this should work great :)

&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;
&lt;script&gt;
    $(document).ready(function(){

    //get the height and width of the page
    var window_width = $(window).width();
    var window_height = $(window).height();

    //vertical and horizontal centering of modal window(s)
    /*we will use each function so if we have more then 1
    modal window we center them all*/
    $(&#039;.modal_window&#039;).each(function(){

        //get the height and width of the modal
        var modal_height = $(this).height();
        var modal_width = $(this).width();

        //calculate top and left offset needed for centering
        var top = (window_height-modal_height)/2;
        var left = (window_width-modal_width)/2;

        //apply new top and left css values
        $(this).css({&#039;top&#039; : top , &#039;left&#039; : left});

    });

        $(&#039;.activate_modal&#039;).click(function(){

              //get the id of the modal window stored in the name of the activating element
              var modal_id = $(this).attr(&#039;name&#039;);

              //use the function to show it
              show_modal(modal_id);

        });

        $(&#039;.close_modal&#039;).click(function(){

            //use the function to close it
            close_modal();

        });

    });

    //THE FUNCTIONS

    function close_modal(){

        //hide the mask
        $(&#039;#mask&#039;).fadeOut(500);

        //hide modal window(s)
        $(&#039;.modal_window&#039;).fadeOut(500);

    }
    function show_modal(modal_id){

        //set display to block and opacity to 0 so we can use fadeTo
        $(&#039;#mask&#039;).css({ &#039;display&#039; : &#039;block&#039;, opacity : 0});

        //fade in the mask to opacity 0.8
        $(&#039;#mask&#039;).fadeTo(500,0.8);

         //show the modal window
        $(&#039;#&#039;+modal_id).fadeIn(500);

    }

&lt;/script&gt;

&lt;style&gt;
        #mask{
        position:absolute; /* important */
        top:0px; /* start from top */
        left:0px; /* start from left */
        height:100%; /* cover the whole page */
        width:100%;  /* cover the whole page */
        display:none; /* don&#039;t show it &#039;*/

        /* styling bellow */
        background-color: black;
    }

    .modal_window{
        position:absolute; /* important so we can position it on center later */
        display:none; /* don&#039;t show it */
		z-index:99;
		width:300px; height:300px;
        /* styling bellow */
        color:#000;
		background-color:#fff;
    }

    /* style a specific modal window  */
    #modal_window{
        padding:50px;
        border:1px solid gray;
        background: #246493;
        color:black;
    }

&lt;/style&gt;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Hey John, this should work great <img src='http://web.enavu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre name="code" class="html">
<script>
    $(document).ready(function(){

    //get the height and width of the page
    var window_width = $(window).width();
    var window_height = $(window).height();

    //vertical and horizontal centering of modal window(s)
    /*we will use each function so if we have more then 1
    modal window we center them all*/
    $('.modal_window').each(function(){

        //get the height and width of the modal
        var modal_height = $(this).height();
        var modal_width = $(this).width();

        //calculate top and left offset needed for centering
        var top = (window_height-modal_height)/2;
        var left = (window_width-modal_width)/2;

        //apply new top and left css values
        $(this).css({'top' : top , 'left' : left});

    });

        $('.activate_modal').click(function(){

              //get the id of the modal window stored in the name of the activating element
              var modal_id = $(this).attr('name');

              //use the function to show it
              show_modal(modal_id);

        });

        $('.close_modal').click(function(){

            //use the function to close it
            close_modal();

        });

    });

    //THE FUNCTIONS

    function close_modal(){

        //hide the mask
        $('#mask').fadeOut(500);

        //hide modal window(s)
        $('.modal_window').fadeOut(500);

    }
    function show_modal(modal_id){

        //set display to block and opacity to 0 so we can use fadeTo
        $('#mask').css({ 'display' : 'block', opacity : 0});

        //fade in the mask to opacity 0.8
        $('#mask').fadeTo(500,0.8);

         //show the modal window
        $('#'+modal_id).fadeIn(500);

    }

</script>
<style>
        #mask{
        position:absolute; /* important */
        top:0px; /* start from top */
        left:0px; /* start from left */
        height:100%; /* cover the whole page */
        width:100%;  /* cover the whole page */
        display:none; /* don't show it '*/

        /* styling bellow */
        background-color: black;
    }

    .modal_window{
        position:absolute; /* important so we can position it on center later */
        display:none; /* don't show it */
		z-index:99;
		width:300px; height:300px;
        /* styling bellow */
        color:#000;
		background-color:#fff;
    }

    /* style a specific modal window  */
    #modal_window{
        padding:50px;
        border:1px solid gray;
        background: #246493;
        color:black;
    }
</style>
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: john</title>
		<link>http://web.enavu.com/tutorials/how-to-make-a-completely-reusable-jquery-modal-window/comment-page-1/#comment-17488</link>
		<dc:creator>john</dc:creator>
		<pubDate>Wed, 01 Dec 2010 01:40:30 +0000</pubDate>
		<guid isPermaLink="false">http://tutsvalley.com/?p=223#comment-17488</guid>
		<description>hi, i got this working partially in my site... unfortunately, after adding the first patch: 

code: 
var document_height = $(document).height();
$(‘#mask’).css({ ‘width’ : window_width, ‘height’ : document_height });&quot;

the popup and mask won&#039;t work...
without it, it works fine except for the mask that doesn&#039;t fill all.. :(

is there a new update on this module?
thanks :D</description>
		<content:encoded><![CDATA[<p>hi, i got this working partially in my site&#8230; unfortunately, after adding the first patch: </p>
<p>code:<br />
var document_height = $(document).height();<br />
$(‘#mask’).css({ ‘width’ : window_width, ‘height’ : document_height });&#8221;</p>
<p>the popup and mask won&#8217;t work&#8230;<br />
without it, it works fine except for the mask that doesn&#8217;t fill all.. <img src='http://web.enavu.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>is there a new update on this module?<br />
thanks <img src='http://web.enavu.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carlos</title>
		<link>http://web.enavu.com/tutorials/how-to-make-a-completely-reusable-jquery-modal-window/comment-page-1/#comment-3180</link>
		<dc:creator>Carlos</dc:creator>
		<pubDate>Sat, 22 May 2010 15:52:26 +0000</pubDate>
		<guid isPermaLink="false">http://tutsvalley.com/?p=223#comment-3180</guid>
		<description>Hi There, great solution and thanks for it, I´m try to understand it, because I´m new at this (Web Programming).

I want to know how can I call a different page with a link?? (I don´t want to have the divs in the same page)

Many Thanks!!</description>
		<content:encoded><![CDATA[<p>Hi There, great solution and thanks for it, I´m try to understand it, because I´m new at this (Web Programming).</p>
<p>I want to know how can I call a different page with a link?? (I don´t want to have the divs in the same page)</p>
<p>Many Thanks!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mary</title>
		<link>http://web.enavu.com/tutorials/how-to-make-a-completely-reusable-jquery-modal-window/comment-page-1/#comment-1223</link>
		<dc:creator>mary</dc:creator>
		<pubDate>Fri, 05 Mar 2010 12:20:02 +0000</pubDate>
		<guid isPermaLink="false">http://tutsvalley.com/?p=223#comment-1223</guid>
		<description>This is a great find. I was looking for something else but found this solution instead... will definitely implement it. This saves the trouble of having to name a lot of divs and form elements and attaching events to each a#openwindow1, a#openwindow2... Thanks!</description>
		<content:encoded><![CDATA[<p>This is a great find. I was looking for something else but found this solution instead&#8230; will definitely implement it. This saves the trouble of having to name a lot of divs and form elements and attaching events to each a#openwindow1, a#openwindow2&#8230; Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Boba</title>
		<link>http://web.enavu.com/tutorials/how-to-make-a-completely-reusable-jquery-modal-window/comment-page-1/#comment-1222</link>
		<dc:creator>Boba</dc:creator>
		<pubDate>Wed, 27 Jan 2010 15:23:35 +0000</pubDate>
		<guid isPermaLink="false">http://tutsvalley.com/?p=223#comment-1222</guid>
		<description>@RBence - Don&#039;t mention it, glad to help. :)</description>
		<content:encoded><![CDATA[<p>@RBence &#8211; Don&#8217;t mention it, glad to help. <img src='http://web.enavu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

