squishy
01-14-2006, 11:37 AM
Hello. I am an amateur at web design, at best. I know that JavaScript can be used upon the loading of a page to assign values to css, and they together can be used in dhtml. I know that css values can be assigned to elements based on their element name, attributes and their values, class, and id. Its interesting and I am still learning. Most importantly, though, and more to my point, css values can also be assigned to elements based on their relation to other tags.
But here is my question. Does the reverse also work? If I called a javascript function within an element, say for example using onMouseOver, can the function be programmed to take different action based on where that function was embedded in relation to other tags? I guess what I am asking to some degree is not whether script can effect css, but whether css can effect script... and not in terms of finding an attributes value first and segregating the program from there, but in terms of where the function is embedded within html. One function having multiple purposes depending on what tag it is the daugher or sibling of (or class, id), etc. What I am suggesting is that the javascript function can determine where it is inside of the html, just as css values are assigned based on one tags relation to another.
I dont know if this is possible, or even if its practical, or even if my question made any sense... but the curiosity is there to understand this concept... and if it ever will be possible perhaps someone would find a use for it.
But here is my question. Does the reverse also work? If I called a javascript function within an element, say for example using onMouseOver, can the function be programmed to take different action based on where that function was embedded in relation to other tags? I guess what I am asking to some degree is not whether script can effect css, but whether css can effect script... and not in terms of finding an attributes value first and segregating the program from there, but in terms of where the function is embedded within html. One function having multiple purposes depending on what tag it is the daugher or sibling of (or class, id), etc. What I am suggesting is that the javascript function can determine where it is inside of the html, just as css values are assigned based on one tags relation to another.
I dont know if this is possible, or even if its practical, or even if my question made any sense... but the curiosity is there to understand this concept... and if it ever will be possible perhaps someone would find a use for it.