Log in

View Full Version : varying DIV id



name1
08-31-2007, 03:41 PM
http://www.dynamicdrive.com/dynamicindex5/overlapcontent.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

ddadmin
08-31-2007, 07:22 PM
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.

name1
09-01-2007, 03:53 AM
10x but can you give a code example?

ddadmin
09-01-2007, 09:01 AM
It depends completely on how your pages are generated and using what language. How are your pages set up?