SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    Ann Arbor, MI
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with hiding/showing DIVs

    OK, a bit of a problem:

    I have a dynamically generated page that has a rollover div that needs to be displayed for each of a number of links.

    Now, this is easy enough to do on a small scale: as part of the loop that dynamically generates the page, I have a separate hidedivlinkID() and showdivlinkID() function, and it works really well except in NS4.x, which I'm not supporting.

    However, once the list of links grows to a certain size--and in this case the list has grown to about 150--the page takes on a rather large size. At this point, it's around 250K.

    What I'd like to do is have a single pair of functions in the header script:

    function showdiv(linkID) { }
    function hidediv(linkID) { }

    Such that I can call them easily. The problem comes in at the point where I try to pass the linkID out of the function, into the style-changing parts of the function. To wit:

    PHP Code:
        function showdiv(linkID) {
            
    linkID.style.visibility "visible"
            
    document.getElementById("legend").style.visibility "hidden"
        
    // End showdiv 
    doesn't work. (The "legend" div is separate and unique; it's not overduplicated). Similarly,

    PHP Code:
        function showdiv(linkID) {
            
    document.getElementById(linkID).style.visibility "visible"
            
    document.getElementById("legend").style.visibility "hidden"
        
    // End showdiv 
    doesn't work.

    Is there any way to make this work... or am I stuck with a bunch of extra functions on my page?

    Eric Snyder II

    (Edit: Closed tag. --ES2)
    Last edited by LazarusLong42; Sep 29, 2001 at 21:21.
    inVirtuo Design. Now open for business.

  2. #2
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    250K?????

    Have you tried cutting the page into 5 or more pages? Remember, you are writing a web page, not a database engine. The reason I suggest this, I have heard of sites crashing, losing information, etc. once the page becomes overly large.

    Categorize your links; have a main page that then transfers control to a specific page, dependent upon the category.

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    Ann Arbor, MI
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Mea culpa... I didn't make it clear that this _is_ a database frontend. It's a site that allows people to easiliy create and control play-by-email games for a strategy game (yet another Chess In Space variant).

    The page in question is a listing of all of the avilable games. It rarely will be viewed, but it's impossible to categorize them _and_ view all at the same time. Since there are nigh 100 games currently in progress, this causes the page size to be high even without being nice-looking.

    (Through other edits, the page size is now down at 170K. The text-based, non-JS page is at 80K.)

    So... any thoughts on the initial question?

    Eric Snyder II/LL
    inVirtuo Design. Now open for business.


Bookmarks

Posting Permissions

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