i tried using stopPropagation in mozilla
but it is not working properly
can u check my code and test page
[CODE=javascript]
var elems=document. getElementsByTa gName("div");
var d=document.getE lementById("myd iv");
var flag=(new Date()).getTime ();
function show(val)
{
flag=(new Date()).getTime ();
if(d.style.disp lay!='')
{
d.style.display ='';...
User Profile
Collapse
-
i tried to rework the code today and i think the problem is solved
i will also look into stopPropogation and cancelBubble as well after this
this is the code i am using
[CODE=javascript]var flaga=new Array();
var flagb=new Array();
var d=document.getE lementById('myd iv');
function hiding()
{
for(var i=0;i<flaga.len gth;i++)
{
if((new Date()).getTime ()-flag...Leave a comment:
-
the way you are calling the childnodes is not correct but it still works in IE
try these out
[CODE=javascript]
function fSetSelectedDay (my)
{
for(i=0;i<my.ch ildNodes.length ;i++)
{
if(my.childNode s[i].id=='calDateTe xt')
{
alert(my.childN odes[i].innerHTML);
break;
}
}
}
[/CODE]
or this one if u dont know id...Leave a comment:
-
i havent seen much of your code but when i went to your test page, you seem to be missing an opening bracket after your function button1_onclick () in line 194
[HTML]<script id="clientEvent HandlersJS" language="javas cript">function button1_onclick () var correct,Total;. ......[/HTML]
and in line 234 u have put a <br /> in js code after the function button1_onclick ()
[HTML]script id="clientEvent HandlersJS"...Leave a comment:
-
i want that when my mouse is over any of my divs with show and hide functions, the div should not hide
but what happens is that if i mouseover a div which shows the 2nd div, and if the 2nd div overlaps the 1st div from any sides and i move my mouse to the 2nd div without going out of 1st div, it fires the onmouseover event of 2nd div and while still moving inside the 2nd div, if the boundaries of 1st div are crossed, the mouseout event from...Leave a comment:
-
there is another problem now
i have put the functions i called at onmouseover and onmouseout on both the div elements now
and when i hover on 1st div, it opens the 2nd div
now if i put my 2nd div somewhat above the 1st div and take my mouse from 1st div to 2nd div without getting out from 1st div, the onmouseover event of 2nd div gets fired, and when i continue moving the mouse inside 2nd div and get out of 1st div, the...Leave a comment:
-
there is a little problem as well
when i put
[CODE=javascript]if((new Date()).getTime ()-flag<2000)[/CODE]
insted of
[CODE=javascript]if((new Date()).getTime ()-flag<1999)[/CODE]
the div sometimes stays there even when at timeout, not a big problem but just a difference of a millisecond removes it
but since i am checking for value less than 2000 ms, it should work every time as i am calling setTimeout...Leave a comment:
-
yea my last post was reply to your question and after posting i saw ur post not there :PLeave a comment:
-
-
yes i want to wait for a few seconds before hiding the div element if user has moved his mouse away from the hover element kinda putting a delayed hide but if the user gets back on the hover element before timeout of hiding of div, the div should not get hidden and a new timeout be set when the user hovers out of the hover element againLeave a comment:
-
i think i got it working but not too sure
I dont know if it can be achieved by any other way as well
i changed my code to include a timestamp in flag
and checked for the difference in current time and timestamp
[CODE=javascript]
var flag=(new Date()).getTime ();
var d=document.getE lementById('myd iv');
var s=document.getE lementById('che cking');
function hiding()
{
...Leave a comment:
-
showing and hiding an element
i am trying to show and hide a div when onmouseover and onmouseover another div element.
i am setting a setTimeout duration on onmouseout to delay the hiding of div for around two second
The problem is that when i mouseover an element and then onmouseout it and then back again mouseovers that element before the timeout, the element still gets hidden
so i put a flag=1 when i mouseover the element and flag=0 at mouseout and checked... -
thank you very much dasty
it worked just perfectly
and now i know where i made it wrong
i just invoked every child of an element and used elem=elem.nextS ibling which made me go through all the elements over and over againLeave a comment:
-
thanks dasty
i changed the i to var i and atleast i went further deeper in the child elements but i was locked up in an infinite loop in some elementsLeave a comment:
-
well i was not getting any errors in the code
it just stopped at some nodes and didnt go ahead
i tried to make another code but im facing same kind of problem in this code as well
maybe i am not getting it to work recursively
[CODE=javascript]function nodeTrav(elem)
{
while(elem)
{
if(elem.nodeTyp e==1)
{
alert("parent node is:"+elem.paren tNode.nodeName+ "...Leave a comment:
-
i tried doing that but by traversing up i could only get my current node's sibling's and its parent's sibling's css but not of their childrenLeave a comment:
-
the main reason i am doing this is to get the css styles of the parent elements
i dont have control of the top element
i just have a script that creates a div and i want to backtrack a fixed number of element and from then on get all the css styles of each child elementLeave a comment:
-
well i am selecting a node and then traversing to its parent a fixed number of times
like if i select an element div with myid in <span><div><d iv id = "myid">
and then go up 2 times and ill get span element.
from that span element i want to get all the child nodes
i am back tracking to span from my div elementLeave a comment:
-
problem traversing through dom
I am trying to get the values of all the child elements from a specific element
[CODE=javascript]
function getnodes(elem)
{
for (i=0; i<elem.childNod es.length; i++)
{
alert(elem.chil dNodes[i].nodeName);
alert(elem.chil dNodes[i].nodeType);
if(elem.childNo des[i].nodeType==1)
{
alert("hello - "+elem.childNod es[i].nodeName);
ge... -
i have embedded the flash file in an html page and when a user opens that page, can we retrieve his browsers userAgent string from actionscriptLeave a comment:
No activity results to display
Show More
Leave a comment: