I found an example code browsing on the internet that I have used to put partly transparent pictures on top of a background image (a map with several areas), The partly transparent pictures is used to change the color of an area when that area of the map is clicked (I have put a transparent image map on top.) In my css style section the display for the pictures is set to display:none I now want to extend the script to make it possible to click on an other part of the background map and change the color of that area without changing the color of the first area. My idea was to use nested arrays for this, and thus reuse the function changeImage. To test this I tried to add a new array but for some reason it doesn't work.
I cannot get the 2 getElementById functions to work and I am a beginner so I am sure it is something simple but I have not been able to fix it. I need to click on the text to change the font.
<?xml version = "1.0" encoding = "utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns = "http://www.w3.org/1999/xhtml">
have a function which finds the highest value of an array and im trying to get it to work on 2 arrays.however I dont really know how to do this so the function works fine on the first array but when i try to make it work on the second one it returns the same value as the first array, even though the second array shouldnt contain that value. I have put the code below, the funtion I am working on is findHighestValueIndex and the arrays I need it to work on are highestScoreIndex and highestWeightedScoreIndex.with the thank user button
I'm trying to nest 7 tab sets in an accordion representing each day of the week. I've tried all kinds of fixes, but no matter what I do, the results are inconsistent. It's easier to see than explain now: [URL]
I'm a perplexed nube, and I can't understand how document.getElementById evaluates to true when no parameter is passed to getElementById. This code alerts 'foo' if (document.getElementById) {alert('foo')} else {alert('bar')}
Just to double check, this code alerts 'bar'
if (!document.getElementById) {alert('foo')} else {alert('bar')}
This seems like a total beginner thing, but I don't know why it isn't working. I'm working from examples from a sitepoint pdf. Here's my html:
Code:
<body> <h1 id="stupid">sdfasd</h1> <p>sdjfa</p>
[code]....
When I run an if statement, I'll get an alert letting me know that the value of target is null, but why is it null? It should contain a reference to the h1 node.
I've got here a sample of my function which is supposed to fade a certain piece of text to another colour. This line is then located in a for loop and it works pretty well in IE 6. However, in Firefox, and thus I assume it will be the same in Netscape and Mozilla, it gives a problem with the: getElementById('main_txt'). Due to that in setTimeout("",) it requires the "" signes and thus I can not use the same ones in the getElement part. IE has no problem with using '' in there, Firefox, however, does. Can anyone think of how to get around this and make firefox do this?
Code: document.getElementById('all_days_div').style.display = 'none'; The HTML section containing the div the Javascript should be hiding Code: <div id="all_days_div" style="display:block;"> <p align="right" > Show All Days </p> </div>
When the JavaScript code is called, instead of hiding the div, I get the following error:"Cannot read property style of null" Do you see anything wrong with what I've written, or is my problem elsewhere?
I have written a number of functions designed to return frequency data on 1000 randomly chosen numbers using different math functions for the rounding. I would like to include all of these functions within the wrapper of another function so that only one call is needed to get returns from all of the 'inner' functions. However, while each of the functions works in isolation, the moment I wrap them in another function they stop working. :confused:
The following code is one of the functions 'frequencyWrapperOne' that has been wrapped in the function 'testWrapper'. A call to testWrapper does nothing.
function testWrapper() { function frequencyWrapperOne() {
I want to restrict getElementById to search children of a specific element instead of searching the entire document, in the same way that I can do getElementsByTagName using a specific element as the parent.
In this particular instance the parent is a table and the elements I'm interested in are all TDs, so I did the basic getElementsByTagName('TD') off the table and looped through this array checking the IDs. However, I'm suspecting that the browser can do getElementById faster than I can do a loop in javascript. Is there a neater way to do this? For now, I'll settle for IE-only solutions, though it would be nice to have things work in generic browsers.
I keep getting an error stating "getElementById("ballElement") is null, but I have a div with that exact id. I have looked at the JS script before that line, but found no errors there either. Please take a minute to see if you find something.
I'm trying to make a web page with tabs which you can navigate between without the page reloading. I have one set of tabs working great, but when I add nested tabs there is a problem with the 'visibility' not being inherited and some parts stay visible in the sub-tabs. Sorry if this is unclear.
Here's how I have it layed out: I have a <span> for each content section of a tab. Then I have do the same thing for the content of each inner tab. When a tab is pressed some javascript code goes through and makes all content sections hidden and the content section for the tab that was pressed visible. If I select a tab and then select an inner tab it looks like is should, but when I try and select a different tab for the outer tabs the content for the inner section doesn't go away. I've found that this is because visibility is not inherited. My question is if anyone has a solution for this problem. I'm sure there is somebody that knows of some javascript trickery to do this.
This code uses a nested IF statement to put a pack of cards into an array of records. But for some reason the cards arn't going in.. like.. at all? I've put a document.write piece of code at end to display the card in the first slot and [object Object] appears? Code:
I'm a greenhorn in SVG and javascripting but I'm learning by doing. So, here my current problem question :
I have a svg document embedded in another svg document. I whant, through functions in an external javascript file, manipulate objects in either the child svg document or the parent document. How do I get access to elements of the other document ?
Example : I have a document "A" containing X/Y - Axis and included another svg document "B" with the graphs.
I whant now, as soon as the mouse cursor is over a graph in document "B" the belonging lable which is located in the parent svg document "A" to change color or size.
Or I whant the graph in "B" to start blinking as soon as the mouse is over the lable in "A".
I don't know how cross document borders.
Can anyone give me a short exapmle to get me going?
i have a nested loop in Javascript and i have a break statement in inner loop. As break statement takes control come out of inner loop. I want to come out of both loops if break statement reaches in inner loop. is there any way to do that ??
Our application has a main window (call it window_1) which opens a popup to display application data (call it window_2). This popup in turn opens a 3rd popup with additional application data (call it window_3). This 3rd popup window should reload window_1 when it loads without reloading window_2.
I develop pages within a third party web application. The page output has tables within tables. I have an 'id' for the table I want, 'oErrorsList' which I then want to find the value of 'SelectedRowID'. I have tried the following code but I get nothing. var myTable.text = $('table').filter('[id=oErrorsList]').SelectedRowID; alert(myTable); I am new to this forum and I don't know if this is enough information so I am including an image of part of the page.
I really can't figure out why it's not working in IE. The only problem I can think of would be using nested loops. Here's the part of the code that isn't working. It's not generating an error, it's just not returning anything. I know you guys hate when I post entire code, so I trimmed it down as much as I can. It's referring to an already stated xml document with xmlDoc. And it's goal is to return a table of rows that meet certain criteria. If you can see any syntax errors that explorer would not like, that's really what I'm asking for.