User Profile

Collapse

Profile Sidebar

Collapse
UberGirl
UberGirl
Last Activity: Aug 19 '09, 02:35 PM
Joined: Aug 11 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • UberGirl
    replied to noscript, onload or something else?
    Well, it's checking the default image (collapse.gif) to see if it's there (which it will be when the page is first loaded). So, if the user has scripts enabled, it changes to the image to expand.gif and collapses all of the divs - so that the expandable tree is in a fully collapsed state to start. But if the user is does not have scripts enabled, nothing happens and the collapse.gif remains with the fully expanded tree.

    I have a...
    See more | Go to post

    Leave a comment:


  • UberGirl
    replied to noscript, onload or something else?
    Dormilich, you rock!

    Thanks a lot - it's working great now. The page is working with or without scripts enabled. I knew it was something simple that I wasn't doing (or doing wrong). I didn't use the else if toggle, as it wasn't needed.

    Your help is MUCH appreciated!

    Thanks again!
    UberGirl
    See more | Go to post

    Leave a comment:


  • UberGirl
    replied to noscript, onload or something else?
    Okay - well thanks! So, here's what's not working...


    This function is being called onload:

    Code:
    function ToggleDivImage() { 
    var boxes = document.getElementsByTagName("img"); 
    for(var i=0;i<boxes.length;i++)  
    if(boxes[i].className.match("ti")) toggleimage(boxes[i]); 
    }

    Which calls this one:

    Code:
    function toggleimage(elem) {
    ...
    See more | Go to post

    Leave a comment:


  • UberGirl
    replied to noscript, onload or something else?
    But my problem is that the default values (i.e. if the user has scripts disabled) needs to be the collapse image, which matches the default value of the expanded divs.

    I thought you said I shouldn't do it onload because the page hasn't loaded yet?? I've tried the onload, and, like I said, the variable gets swapped appropriately but it doesn't show up on the page correctly. I figured there was just something I was missing to apply...
    See more | Go to post

    Leave a comment:


  • UberGirl
    replied to noscript, onload or something else?
    okay - I think I understand. so I need to try to swap them after they load - which would mean calling a script after that point in the body or at the end of the body? sorry - I really am new at this.
    See more | Go to post

    Leave a comment:


  • UberGirl
    replied to noscript, onload or something else?
    Anyone have any ideas on what I need to do to get the image swapped from collapse to expand during body onload?
    See more | Go to post

    Leave a comment:


  • UberGirl
    replied to noscript, onload or something else?
    hide is working, but changing image is not

    I ended up using the code below, calling HideDiv and ToggleDivImage onload, but only hiding the divs on load (function toggledisplay) is working. The function toggleimage isn't, though the alerts I put in place verify that the variable "image" ends up getting changed from collapse.gif to expand.gif. Yet the result isn't reflected on the page (i.e. collapse.gif still shows)....
    See more | Go to post

    Leave a comment:


  • UberGirl
    replied to noscript, onload or something else?
    Thanks, Dormilich.

    I was able to search out some examples using className and I got it to work.
    See more | Go to post

    Leave a comment:


  • UberGirl
    started a topic noscript, onload or something else?

    noscript, onload or something else?

    Hi,
    I'm a novice... just trying figure out something simple, I'm sure.

    I've got a script within my <head> tags to show/hide divs on click:

    Code:
    function showHide(divID, imgID){
    	if (document.getElementById(divID).style.display == "none") {
    		document.getElementById(divID).style.display = "block";
    		document.getElementById(imgID).src = "http://bytes.com/images/collapse.gif";
    ...
    See more | Go to post
    Last edited by gits; Aug 12 '09, 10:21 AM. Reason: fix bold tags -> to [code] tags
No activity results to display
Show More
Working...