Results 1 to 2 of 2
Thread: A total beginners problem
- 02-13-2010, 08:08 PM #1
Member
- Join Date
- Feb 2010
- Posts
- 2
- Rep Power
- 0
A total beginners problem
This is a total beginners problem, but I'm stuck with it and there should be an easy explanation/solution:
Untitled 1
I managed to display/hide the text block through the title, but in addition I want the arrow change according to the state.
You can see in the source of the page what I tried out.
Actually the function is supposed to be called with one argument and the id of the image constructed from that with "-arrow".
tia...
- 02-15-2010, 10:07 PM #2
Member
- Join Date
- Feb 2010
- Posts
- 2
- Rep Power
- 0
Solved it myself
If anybody gets here searching for an answer:
Here is how the script has to look like:
function unhide(divID) {
var item = document.getElementById(divID);
var image = document.getElementById(divID + "-arrow");
if (item) {
item.className=(item.className=='hidden')?'unhidde n':'hidden';
}
if (image.getAttribute("src") == "blogarrowdown.gif") {
image.setAttribute("src","blogarrowright.gif");
} else {
image.setAttribute("src","blogarrowdown.gif");
}
}
</script>
I was able to figure it out after I found a way to output debug information (alert("text")). Somehow my console did not work, but I like the alert-way better anyway.
Similar Threads
-
E-book for servlet beginners?
By makpandian in forum Java ServletReplies: 6Last Post: 03-07-2010, 09:11 PM -
Ebook for java2D for beginners.
By hardiks21 in forum Java 2DReplies: 2Last Post: 02-08-2009, 12:04 PM -
Method and loop, beginners guide please!!
By soc86 in forum New To JavaReplies: 2Last Post: 01-15-2009, 03:00 PM -
Help with beginners program
By DanK in forum New To JavaReplies: 6Last Post: 12-15-2008, 05:02 AM -
what is d best spring book 4 beginners
By shikhin_82@yahoo.co.in in forum Web FrameworksReplies: 3Last Post: 10-17-2008, 04:12 PM


LinkBack URL
About LinkBacks

Bookmarks