Results 1 to 2 of 2
  1. #1
    mbezel is offline Member
    Join Date
    Feb 2010
    Posts
    2
    Rep Power
    0

    Default 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...

  2. #2
    mbezel is offline Member
    Join Date
    Feb 2010
    Posts
    2
    Rep Power
    0

    Default 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

  1. E-book for servlet beginners?
    By makpandian in forum Java Servlet
    Replies: 6
    Last Post: 03-07-2010, 10:11 PM
  2. Ebook for java2D for beginners.
    By hardiks21 in forum Java 2D
    Replies: 2
    Last Post: 02-08-2009, 01:04 PM
  3. Method and loop, beginners guide please!!
    By soc86 in forum New To Java
    Replies: 2
    Last Post: 01-15-2009, 04:00 PM
  4. Help with beginners program
    By DanK in forum New To Java
    Replies: 6
    Last Post: 12-15-2008, 06:02 AM
  5. what is d best spring book 4 beginners
    By shikhin_82@yahoo.co.in in forum Web Frameworks
    Replies: 3
    Last Post: 10-17-2008, 05:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •