Results 1 to 4 of 4

Thread: varying DIV id

  1. #1
    Join Date
    Aug 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default varying DIV id

    http://www.dynamicdrive.com/dynamici...lapcontent.htm

    Hi,
    I would appreciate very much help on varying id using the above link:
    my boss told me to use the above link to enable overlap content.
    The content is shown indeed very nice, as long as it uses for a contant div.
    Unfortunately, I ought to display data from a db, looping on the recordset.
    However, the overlapping DIV is stuck on the first raw since the id of the
    DIV does not change. It is delared as follows (partially):
    <a href="#" onClick="overlayclose('subcontent'); return false">
    ...
    and:
    <td onClick="return overlay(this, 'subcontent')" class="tbranchTxt"
    dir="rtl" align="center" background="images/branch_bg.gif" width="96"
    height="35" style="cursor: hand;">

    I tried to use DIM to make the id as a counter and another way as dynamically allocated string that appends a letter each loop, but
    the given code reads it as f***ing CONSTANT!!!
    ( I saw few javascript funcs that enmurate div id. Still here it is a CONSTANT! ... so it does not help me. I need to both make it a var and looping it)
    Thank you

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    If your entire page is dynamically generated, why not just get the server to append a unique integer to the end of each overlapping content's ID attribute, so they are unique? This is simply a case of dynamically altering your page's source slightly so IDs within the HTML being generated are unique. The same needs to be done with any JavaScript that relies on the ID attribute of elements, not just the overlapping content script.

  3. #3
    Join Date
    Aug 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    10x but can you give a code example?

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    It depends completely on how your pages are generated and using what language. How are your pages set up?

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
  •