<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Erhie</title>
    <description>The latest articles on DEV Community by Erhie (@erhie).</description>
    <link>https://dev.to/erhie</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F939874%2Fe0c4605a-6b1d-473b-8072-2978ec358065.png</url>
      <title>DEV Community: Erhie</title>
      <link>https://dev.to/erhie</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/erhie"/>
    <language>en</language>
    <item>
      <title>how to get height of div in pixels?</title>
      <dc:creator>Erhie</dc:creator>
      <pubDate>Mon, 17 Oct 2022 17:42:47 +0000</pubDate>
      <link>https://dev.to/erhie/how-to-get-height-of-div-in-pixels-8m9</link>
      <guid>https://dev.to/erhie/how-to-get-height-of-div-in-pixels-8m9</guid>
      <description>&lt;p&gt;Hello!&lt;br&gt;
 For a DIV with variable text I hoped to get the height in pixels with the function getComputedStyle, but it delivers auto also if I delay the detection.&lt;br&gt;
Has you a suggestion how to fix it ?&lt;br&gt;
my javascript code snippet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;this.slInfDetail = this.slInfo.appendChild( document.createElement('div') );
s = this.slInfDetail.style;
s.position = "relative";
s.fontSize = `calc(${fontsize} / 2.5 )`
s.textAlign = "left";
s.backgroundColor = "rgba(0,0,0,0.35)";
s.color = "rgb(255,255,255)"
s.zIndex = 999;
this.slInfDetail.innerHTML = "Additional info comes&amp;lt;br&amp;gt;here";
this.slInfComputedHeight;
setTimeout(() =&amp;gt; {
    let sComputed = getComputedStyle(this.slInfDetail);
    this.slInfComputedHeight = sComputed.height; // is 'auto' 
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>XOR color in stacked div ?</title>
      <dc:creator>Erhie</dc:creator>
      <pubDate>Mon, 17 Oct 2022 13:12:24 +0000</pubDate>
      <link>https://dev.to/erhie/xor-color-in-stacked-div--2imh</link>
      <guid>https://dev.to/erhie/xor-color-in-stacked-div--2imh</guid>
      <description>&lt;p&gt;Hello!&lt;br&gt;
I want to display a info box with follows the mouse position.&lt;br&gt;
I have defined the background color transparent.&lt;br&gt;
Sometimes the text is not identifiably because the subjacent element has the same color.&lt;br&gt;
&lt;strong&gt;Do you know a method or property that the color change dynamically?&lt;/strong&gt;&lt;br&gt;
Perhaps that the color is XOR of the color of the subjacent element.&lt;/p&gt;

&lt;p&gt;Thank you for tips&lt;br&gt;
Erhie&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>zindex</category>
    </item>
    <item>
      <title>sequence of parameters with bind()</title>
      <dc:creator>Erhie</dc:creator>
      <pubDate>Mon, 10 Oct 2022 12:49:24 +0000</pubDate>
      <link>https://dev.to/erhie/sequence-of-parameters-in-bind-13em</link>
      <guid>https://dev.to/erhie/sequence-of-parameters-in-bind-13em</guid>
      <description>&lt;p&gt;I try to put some html element object in a class und&lt;br&gt;
write addEventListener which should work for all instances.&lt;/p&gt;

&lt;p&gt;I found a solution, but I don´t understand it.&lt;br&gt;
eg.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class ValueSlider extends HTMLDivElement {
    constructor() {
        .  .  .
        this.startDrag = function(el, evt) {
            let thisNow = this; // class object
            let element = el; // mySvg object
            let event = evt; // event object
            .  .  .
        }

        this.evHandler = this.startDrag.bind(this, this.mySvg);

        this.mySvg.addEventListener("mousedown", this.evHandler );
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why the function receives the event object as last parameter ?&lt;/p&gt;

&lt;p&gt;Thank you for discussion&lt;br&gt;
Erhie&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>bind</category>
    </item>
  </channel>
</rss>
