<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Techy Things &#187; html</title>
	<atom:link href="https://tech.yipp.ca/category/html/feed/" rel="self" type="application/rss+xml" />
	<link>https://tech.yipp.ca</link>
	<description>Just another Yipp.ca Blogs site</description>
	<lastBuildDate>Thu, 01 May 2025 18:06:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.2.38</generator>
	<item>
		<title>Mousewheel prevent body scroll on modal</title>
		<link>https://tech.yipp.ca/automation/backbone-prevent-body-scroll-modal/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=backbone-prevent-body-scroll-modal</link>
		<comments>https://tech.yipp.ca/automation/backbone-prevent-body-scroll-modal/#comments</comments>
		<pubDate>Tue, 09 May 2017 13:59:19 +0000</pubDate>
		<dc:creator><![CDATA[frank]]></dc:creator>
				<category><![CDATA[automation]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://tech.yipp.ca/?p=2802</guid>
		<description><![CDATA[<p>Solution #1   // prevent background of modal from scrolling   // DOMMouseScroll for Firefox equivalent   $(document).on("mousewheel DOMMouseScroll", ".modal-backdrop, .modal-body", function(event) {     event.stopPropagation();     event.preventDefault();   });   // prevent background of&#46;&#46;&#46;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/automation/backbone-prevent-body-scroll-modal/">Mousewheel prevent body scroll on modal</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Solution #1</p>
<pre>  // prevent background of modal from scrolling
  // DOMMouseScroll for Firefox equivalent
  $(document).on("mousewheel DOMMouseScroll", ".modal-backdrop, .modal-body", function(event) {
    event.stopPropagation();
    event.preventDefault();
  });

  // prevent background of modal from scrolling
  var keysThatScroll = new Array(33,34,35,36,37,38,39,40);
  var DEBUG_KEY_SCROLL_PREVENTION = false;
  $(document).on("keydown", function(event) {
    var key = event.which;
    if ($.inArray(key,keysThatScroll) === -1) {
      if (DEBUG_KEY_SCROLL_PREVENTION) console.log("no worries for this key", key);
      return true; // no worries for this key
    }

    if ($(".modal-backdrop").length === 0) {
      if (DEBUG_KEY_SCROLL_PREVENTION) console.log("no modification when modal is off");
      return true; // no worries for these keys
    }

    if (event.target == null || event.target.tagName == null) { // should not happen
      if (DEBUG_KEY_SCROLL_PREVENTION) console.log("event.target or event.target.tagName is null or undefined");
      return true;
    }

    if (event.target.tagName.toLowerCase() === "body") {
      if (DEBUG_KEY_SCROLL_PREVENTION) console.log("keydown, on body, stopping");
      event.preventDefault();
      return false;
    }

    if (event.target.type == null) {
      if (DEBUG_KEY_SCROLL_PREVENTION) console.log("keydown, no type and not body, letting go");
      return true; // ok keep going
    }

    var type = event.target.type.toLowerCase();
    if (DEBUG_KEY_SCROLL_PREVENTION) console.log("keydown, type", type);
    if (type == 'input' || type == 'text' || type == 'textarea' ||type == 'select') {
      // normal keyup and keydown allowed in modals
      return true; // ok keep going
    }
    
    // stop scrolling keys in modal of further effects, for example if focus is on a button and keydown
    event.preventDefault();
    event.stopPropagation();
    return false; // in jQuery returning false does the same as preventDefault and stopPropagation
  });</pre>
<pre>Solution #2

   // extend Bootstrap modal to remove scrollbar during modal show
   var _show = $.fn.modal.Constructor.prototype.show;
   $.fn.modal.Constructor.prototype.show = function() {
      _show.apply(this, arguments);
      $("body").addClass("modal-on");
   };
   var _hide = $.fn.modal.Constructor.prototype.hide;
   $.fn.modal.Constructor.prototype.hide = function() {
      _hide.apply(this, arguments);
      $("body").removeClass("modal-on");
   };

along with CSS

html,
body {
   width: 100%;
   height: 100%;
   padding: 0;
   margin: 0;
}
body {
   overflow-y: scroll;
}

body.modal-on {
   overflow:hidden;
}


</pre>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/automation/backbone-prevent-body-scroll-modal/">Mousewheel prevent body scroll on modal</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://tech.yipp.ca/automation/backbone-prevent-body-scroll-modal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Handling input disabled=&quot;disabled&quot; and prop-checked state in HTML5</title>
		<link>https://tech.yipp.ca/html5/handling-input-disableddisabled-prop-checked-state-html5/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=handling-input-disableddisabled-prop-checked-state-html5</link>
		<comments>https://tech.yipp.ca/html5/handling-input-disableddisabled-prop-checked-state-html5/#comments</comments>
		<pubDate>Wed, 08 Apr 2015 19:18:35 +0000</pubDate>
		<dc:creator><![CDATA[frank]]></dc:creator>
				<category><![CDATA[html]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://tech.yipp.ca/?p=1670</guid>
		<description><![CDATA[<p>&#160; Should I use disabled="disabled" or only disabled ? For HTML, &#60;input type="text" disabled="disabled" /&#62; is a safe markup. For HTML5, &#60;input type="text" disabled /&#62; is valid and preferred. How to modify the checkbox state with jQuery :&#46;&#46;&#46;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/html5/handling-input-disableddisabled-prop-checked-state-html5/">Handling input disabled="disabled" and prop-checked state in HTML5</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>&nbsp;</p>
<p>Should I use disabled="disabled" or only disabled ?</p>
<ul>
<li>For HTML, <code>&lt;input type="text" disabled="disabled" /&gt;</code> is a safe markup.</li>
<li>For HTML5, <code>&lt;input type="text" disabled /&gt;</code> is valid and preferred.</li>
</ul>
<p>How to modify the checkbox state with jQuery :</p>
<ul>
<li>$(".mySelector").prop("checked", true);</li>
</ul>
<p>How to modify the disabled state with jQuery :</p>
<ul>
<li>$(".mySelector").prop("disabled", true);</li>
</ul>
<p>&nbsp;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/html5/handling-input-disableddisabled-prop-checked-state-html5/">Handling input disabled="disabled" and prop-checked state in HTML5</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://tech.yipp.ca/html5/handling-input-disableddisabled-prop-checked-state-html5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS filter opacity for cross-browser transparency</title>
		<link>https://tech.yipp.ca/css/css-filter-opacity-cross-browser-transparency/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=css-filter-opacity-cross-browser-transparency</link>
		<comments>https://tech.yipp.ca/css/css-filter-opacity-cross-browser-transparency/#comments</comments>
		<pubDate>Wed, 04 Mar 2015 17:36:32 +0000</pubDate>
		<dc:creator><![CDATA[frank]]></dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://tech.yipp.ca/?p=1567</guid>
		<description><![CDATA[<p>Solution To reach almost all users now (in 2015) : opacity:0; filter: "alpha(opacity=0)"; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; The full CSS cross-browser (some might be useless now) opacity:0; filter: "alpha(opacity=0)"; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; -moz-opacity: 0.5; -khtml-opacity: 0.5;  </p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/css/css-filter-opacity-cross-browser-transparency/">CSS filter opacity for cross-browser transparency</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Solution</p>
<p>To reach almost all users now (in 2015) :</p>
<p>opacity:0;<br />
filter: "alpha(opacity=0)";<br />
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";</p>
<p>The full CSS cross-browser (some might be useless now)</p>
<p>opacity:0;<br />
filter: "alpha(opacity=0)";<br />
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";<br />
-moz-opacity: 0.5;<br />
-khtml-opacity: 0.5;</p>
<p><span class="token punctuation" style="box-sizing: border-box; color: white; font-family: 'Source Code Pro', Menlo, Consolas, Monaco, monospace; font-size: 16.2000007629395px; line-height: 24.2999992370605px; white-space: pre; background-color: #1d1f21;"> </span></p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/css/css-filter-opacity-cross-browser-transparency/">CSS filter opacity for cross-browser transparency</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://tech.yipp.ca/css/css-filter-opacity-cross-browser-transparency/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Best ways to center align div with CSS</title>
		<link>https://tech.yipp.ca/html/best-ways-center-align-divisions-css/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=best-ways-center-align-divisions-css</link>
		<comments>https://tech.yipp.ca/html/best-ways-center-align-divisions-css/#comments</comments>
		<pubDate>Sat, 27 Dec 2014 18:31:40 +0000</pubDate>
		<dc:creator><![CDATA[frank]]></dc:creator>
				<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://tech.yipp.ca/?p=1364</guid>
		<description><![CDATA[<p>Center align division with CSS Solution #1 - margin 0 auto This is an often-used and widely supported method and clean. However the drawback is you have to specify the width of the item.&#46;&#46;&#46;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/html/best-ways-center-align-divisions-css/">Best ways to center align div with CSS</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></description>
				<content:encoded><![CDATA[<h2>Center align division with CSS</h2>
<h2>Solution #1 - margin 0 auto</h2>
<p>This is an often-used and widely supported method and clean. However the drawback is you have to specify the <span style="color: #ff6600;"><strong>width</strong></span> of the item. This reduce the flexibility and can be used only in limited scenarios.</p>
<pre>margin:0 auto;
width:80%;</pre>
<h2>Solution #2 - left -50%, left 50%</h2>
<div>This solution fixes the limitation where you have to specify the width of the content. With the code below, the container would be class="menu" and your content would be the &lt;ul&gt;&lt;/ul&gt; which could have any content and would always be center-aligned !</div>
<pre>div#menu-primary .menu {
    float: right;
    left: -50%;
    position: relative;
}
div#menu-primary .menu ul {
    left: 50%;
    list-style: none outside none;
    position: relative;
}</pre>
<p>Test:</p>
<div style="float: right; left: -50%; position: relative;">
<ul style="left: 50%; list-style: none outside none; position: relative;">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
</div>
<p>&nbsp;</p>
<h2>Solution #3 - Traditional center alignment</h2>
<pre>&lt;center&gt;
&lt;div align="center"&gt;&lt;/div&gt;
&lt;/center&gt;</pre>
<p>&nbsp;</p>
<div align="center">Test !</div>
<p>This is not proper modern code, but is supported by all and the most older (ancient) browser - hence makes it the most widely supported solution.</p>
<h2>Solution #4 - Use inline-block inside display:table div</h2>
<div style="display: table; margin: auto;"><span style="display: inline-block;"><br />
variable width div.. for example english/french text of different width<br />
</span></div>
<h2>Solution #5 - Use inline-block inside a text-align:center element</h2>
<p>This is not supported by IE6, 7 or 8.</p>
<div style="text-align: center;">
<div style="display: inline-block;">Test fails in IE6, IE7 and IE8</div>
</div>
<p>&nbsp;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/html/best-ways-center-align-divisions-css/">Best ways to center align div with CSS</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://tech.yipp.ca/html/best-ways-center-align-divisions-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ending the z-index madness and avoiding 9999 z-indexes</title>
		<link>https://tech.yipp.ca/html/ending-the-z-index-madness/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ending-the-z-index-madness</link>
		<comments>https://tech.yipp.ca/html/ending-the-z-index-madness/#comments</comments>
		<pubDate>Sat, 15 Mar 2014 17:52:16 +0000</pubDate>
		<dc:creator><![CDATA[frank]]></dc:creator>
				<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://tech.yipp.ca/?p=626</guid>
		<description><![CDATA[<p>Most web developers do this error. They think that all divisions are stacked relative to all other divisions' z-index values and thus you end up seeing z-index up to 99999. This is crazy. I&#46;&#46;&#46;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/html/ending-the-z-index-madness/">Ending the z-index madness and avoiding 9999 z-indexes</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Most web developers do this error. They think that all divisions are stacked relative to <em>all</em> other divisions' z-index values and thus you end up seeing z-index up to 99999. This is crazy.</p>
<p>I never need to go above <strong>10</strong> for z-index.</p>
<p>The thing people don't know is that within a z-index-stacked division, the z-index count restarts at 0. This means if you are inside a z-index-5 division stacked on top of other divisions, then everything you put inside it will be based on a base 5 z-index. Then you can restart the count at 0 inside this division.</p>
<div style="position: relative; z-index: 7; background: #caffca; width: 200px; height: 300px; padding: 10px;">z-index:7</p>
<div style="position: relative; z-index: 1; background: #ffd94f; width: 500px; height: 100px; top: 30px; left: 20px; padding: 10px;">z-index:1</div>
</div>
<div style="position: relative; z-index: 5; background: #83ddff; left: 300px; top: -300px; margin-bottom: -300px; width: 200px; height: 300px; padding: 10px;">z-index:5</div>
<br/>

<p>In the example above, a division with z-index 1 inside a division of z-index 7 will render <strong>above</strong> another division of z-index 5.</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/html/ending-the-z-index-madness/">Ending the z-index madness and avoiding 9999 z-indexes</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://tech.yipp.ca/html/ending-the-z-index-madness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to grow a div to the maximum width available of parent div without exceeding it</title>
		<link>https://tech.yipp.ca/html/how-to-grow-a-div-to-the-maximum-width-available-of-parent-div-without-exceeding-it/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-grow-a-div-to-the-maximum-width-available-of-parent-div-without-exceeding-it</link>
		<comments>https://tech.yipp.ca/html/how-to-grow-a-div-to-the-maximum-width-available-of-parent-div-without-exceeding-it/#comments</comments>
		<pubDate>Sun, 05 Jan 2014 23:01:29 +0000</pubDate>
		<dc:creator><![CDATA[frank]]></dc:creator>
				<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://tech.yipp.ca/?p=466</guid>
		<description><![CDATA[<p>Solving the world's HTML problems one by one This is something that is often useful when you have two embedded divisions. You set the parent width in percentage, and want the inner div to&#46;&#46;&#46;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/html/how-to-grow-a-div-to-the-maximum-width-available-of-parent-div-without-exceeding-it/">How to grow a div to the maximum width available of parent div without exceeding it</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></description>
				<content:encoded><![CDATA[<h1>Solving the world's HTML problems one by one</h1>
<p>This is something that is often useful when you have two embedded divisions. You set the parent width in percentage, and want the inner div to spread out automatically up the parent's size with some margin around it to create a nice border effect.</p>
<p>I journeyed across seas and mountains to query the Great Html Oracle Spirit and I bring back two solutions :</p>
<h2><span style="font-size: 13px;"> </span>The "Absolute" Solution</h2>
<p>Use <em>position:absolute</em> and <strong>do not</strong> specify any width and height. However specify top:20px; left:20px; right:20px; botton:20px; !</p>
<pre>&lt;div id="rich-text-editor" style="position:absolute; z-index:6; top:40px; left:40px; width:80%; height:90%; background-color:gray; border-radius:20px;"&gt;
 &lt;div style="position:absolute; top:20px; left:20px; right:20px; bottom:20px; background-color:black; border-radius:10px; "&gt;
 &lt;/div&gt;
&lt;/div&gt;</pre>
<div id="rich-text-editor" style="position:relative; z-index:6; top:0px; left:40px; width:80%; height:80px; background-color:gray;border-radius:20px;  ">
<div style="position:absolute; top:20px; left:20px; right:20px; bottom:20px; background-color:black;border-radius:10px; ">
 </div>
</div>
<p>&nbsp;</p>
<h2><span style="font-size: 13px;"> </span>The "Border" Solution</h2>
<p>Use a single division with fat borders of several pixels. You can even make those borders rounded using CSS ! However compared to the solution above, you could just have the outer border rounded : the inner border will be squared.</p>
<pre>&lt;div id="rich-text-editor" style="position:absolute; z-index:6; top:40px; left:40px; width:80%; height:90%; background-color:black; border:15px solid gray; border-radius:10px; "&gt; stuff here &lt;/div&gt;</pre>
<p>&nbsp;</p>
<div id="rich-text-editor" style="position: relative; z-index: 6; top: -10px; left: 40px; width: 80%; height: 80px; background-color: black; border: 15px solid gray; border-radius: 10px;">stuff here</div>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/html/how-to-grow-a-div-to-the-maximum-width-available-of-parent-div-without-exceeding-it/">How to grow a div to the maximum width available of parent div without exceeding it</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://tech.yipp.ca/html/how-to-grow-a-div-to-the-maximum-width-available-of-parent-div-without-exceeding-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
