<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1042598" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1042598</link>
    <description></description>
    <language>en</language>
          <item>
    <title>I think the code breaks down</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/settimeout-not-working#comment-1236677</link>
    <description> &lt;p&gt;I think the code breaks down when the function does not know what &quot;this&quot; refers to.&lt;/p&gt;
&lt;p&gt;In my first response on the thread, I showed you how to pass a particular anchor object (this) to the function nextSibling(elm) - note that &quot;this&quot; (the anchor object) becomes &quot;elm&quot; in the function&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Funny thing is that if i dont declare a.onmouseover as a function then when the page loads whatever i want a.onmouseover to do executes as the page loads, but not if i declare it as a function.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;If you put the code in without declaring it as a function, it will execute when it loads. If it is a function, the function needs to be called.&lt;/p&gt;
&lt;p&gt;If you can post a link to the page, or attach an html file, we can test our solutions...&lt;/p&gt;
 </description>
     <pubDate>Fri, 02 Jan 2009 21:40:55 +0000</pubDate>
 <dc:creator>decibel.places</dc:creator>
 <guid isPermaLink="false">comment 1236677 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Hi Decibel,
Yes the</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/settimeout-not-working#comment-1236676</link>
    <description> &lt;p&gt;Hi Decibel,&lt;/p&gt;
&lt;p&gt;Yes the &lt;/p&gt;
&lt;p&gt;a.onmouseover = function(){&lt;br /&gt;
                               this.nextSibling.style.display = &#039;block&#039;;&lt;br /&gt;
                        }&lt;/p&gt;
&lt;p&gt;Does work.&lt;/p&gt;
&lt;p&gt;Funny thing is that if i dont declare a.onmouseover as a function then when the page loads whatever i want a.onmouseover to do executes as the page loads, but not if i declare it as a function.&lt;/p&gt;
&lt;p&gt;How can i pass parametres into the function if i should do this:&lt;/p&gt;
&lt;p&gt;function something(){&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;a.onmouseover = something;&lt;/p&gt;
&lt;p&gt;is this acceptable: a.onmouseover = something(a);&lt;/p&gt;
 </description>
     <pubDate>Fri, 02 Jan 2009 21:17:20 +0000</pubDate>
 <dc:creator>benf</dc:creator>
 <guid isPermaLink="false">comment 1236676 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>benf wrote:
I&#039;m not quite</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/settimeout-not-working#comment-1236530</link>
    <description> &lt;p&gt;&lt;div class=&quot;quote-msg&quot;&gt;&lt;div class=&quot;quote-author&quot;&gt;&lt;em&gt;benf&lt;/em&gt; wrote:&lt;/div&gt;I&#039;m not quite sure what you mean &quot;Define the function properly&quot;?&lt;br /&gt;
The function works, just the setTimeout() does not.&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;are you saying that this works (without the timer)?&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;a.onmouseover = function(){&lt;br /&gt;this.nextSibling.style.display = &amp;#039;block&amp;#039;;&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;I do not think your syntax is correct, first of all using a variable like a.onmouseover, secondly when you declare a function as a variable this way, you still need to define the variable(s) being passed to the function eg&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;var add=function theAdd(a, b) &lt;br /&gt;{&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp; return a+b;&lt;br /&gt;}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;alert(add(1,2));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // produces 3&lt;br /&gt;alert(theAdd(1,2));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // also produces 3&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;(&lt;a href=&quot;http://www.permadi.com/tutorial/jsFunc/index.html&quot;&gt;refer to this page&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;I would do something like&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;function name(){&lt;br /&gt;somecode&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;var theelm = name; //not sure if you need the parentheses here or not...&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;but I am uncertain of the value of assigning the function to a variable&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Notice in my example above&lt;/strong&gt; that I am passing the element object with the mouseover to the function as this/elm&lt;/p&gt;
 </description>
     <pubDate>Sun, 28 Dec 2008 18:30:32 +0000</pubDate>
 <dc:creator>decibel.places</dc:creator>
 <guid isPermaLink="false">comment 1236530 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>hi thanks for your reply,
Im</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/settimeout-not-working#comment-1236501</link>
    <description> &lt;p&gt;hi thanks for your reply,&lt;/p&gt;
&lt;p&gt;Im not quite sure what you mean &quot;Define the function properly&quot;?&lt;/p&gt;
&lt;p&gt;The function works, just the setTimeout() does not.&lt;/p&gt;
&lt;p&gt;Any other advise appreciated.&lt;/p&gt;
 </description>
     <pubDate>Thu, 25 Dec 2008 22:44:13 +0000</pubDate>
 <dc:creator>benf</dc:creator>
 <guid isPermaLink="false">comment 1236501 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>you need to define the</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/settimeout-not-working#comment-1236485</link>
    <description> &lt;p&gt;you need to define the function properly, add an event listener to your anchor tag, and pass &quot;this&quot; to the function&lt;/p&gt;
&lt;p&gt;let&#039;s define the function:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;function nextSibling(elm){&lt;br /&gt;var timer = setTimeout(elm.nextSibling.style.display = &amp;#039;block&amp;#039;, 1000);&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;now let&#039;s set up the anchor&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;a href=&amp;quot;somevalue&amp;quot; onmouseover=&amp;quot;nextSibling(this)&amp;quot;&amp;gt;linkcontent&amp;lt;/a&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;if it&#039;s not a real link, I recommend setting the &lt;code&gt;href=&amp;quot;javascript:void(0)&amp;quot;&lt;/code&gt;&lt;/p&gt;
 </description>
     <pubDate>Wed, 24 Dec 2008 20:01:30 +0000</pubDate>
 <dc:creator>decibel.places</dc:creator>
 <guid isPermaLink="false">comment 1236485 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
