Hi. I think title explain what i have to do (or, i hope so) :) As fist thing, I'll ask patience to everybody for my english!
So... I have to do this : I've some "modules" with : - some select option (in fact, one for hours with 12 value, one for minuts for 60 values and one for seconds with other 60 values); - some input box; - some check box;
I have to load some of these modules dynamically (e.g. i've 10 modules. If i click on "Add new modules" the Jquery function must add a new module).
Now, there aren't problems if i add 1-10 new modules. But if i add more modules, the browser becomes too slow. In fact it add somethings like 200-250 lines for click.
You can see the code added here :
function addTracklines() {
for(i=indice; i<maxline; i++) {
$('#trackline'+(i-1)).after('
<div class="sideoff" id="sideline'+i+'">
<div class="sidespace1"> </div>
<div class="sidelabel1">
Side/Part Name
</div>
<div class="sidelabel2">
<input type="text" disabled="disabled" id="inputrealside'+i+'" name="sides[]" class="inputTLS" maxlength="50" />
<input type="hidden" disabled="disabled" id="inputrealsideindex'+i+'" name="sidesindex[]" value="'+i+'" />
</div>
<div class="sidelabel3">
<a class="lblueb" href="javascript:void(0)" onClick="remSide(\''+i+'\')">Remove</a>
</div>
<div class="sidespace2"> </div>
</div>
<div class="trackon" id="trackline'+i+'">
<div class="trackcounter" id="inputcounter'+i+'">
'+(i+1)+'
</div>
<div class="tracktime1">
<select id="inputhh'+i+'" name="hours[]" class="inputTL1">
<option>??</option>
<option value="">-</option>
<option value="00">00</option>
// ... from 00 to 12....
<option value="12">12</option>
</select>
</div>
<div class="tracktime2">
<select id="inputmm'+i+'" name="minuts[]" class="inputTL1">
<option>??</option>
<option value="">-</option>
<option value="00">00</option>
// ... from 00 to 59....
<option value="59">59</option>
</select>
</div>
<div class="tracktime3">
<select id="inputss'+i+'" name="seconds[]" class="inputTL1">
<option>??</option>
<option value="">-</option>
<option value="00">00</option>
<option value="01">01</option>
// ... from 00 to 59....
<option value="59">59</option>
</select>
</div>
<div class="trackatl">
<input type="text" id="inputatl'+i+'" name="atl[]" class="inputTL2" />
</div>
<div class="trackbotton1">
<select id="inputside'+i+'" onchange="addSide(\''+i+'\');" class="inputTL3">
<option>+ Side</option>
<option value="">------</option>
<option value="1">Before</option>
<option value="2">After</option>
</select>
</div>
<div class="trackbotton2">
<select id="inputtadd'+i+'" onchange="addTrack(\'2\', \''+i+'\');" class="inputTL3">
<option>+ Tracks</option>
<option value="">------</option>
<option value="11">+1 Before</option>
<option value="12">+2 Before</option>
<option value="13">+3 Before</option>
<option value="14">+4 Before</option>
<option value="15">+5 Before</option>
<option value="">------</option>
<option value="21">+1 After</option>
<option value="22">+2 After</option>
<option value="23">+3 After</option>
<option value="24">+4 After</option>
<option value="25">+5 After</option>
</select>
</div>
<div class="trackbotton3">
<a class="lblueb" href="javascript:void(0)" onClick="remTrack(\''+i+'\')">Remove</a>
<input type="hidden" name="trackpos[]" value="#" />
</div>
</div>');
}
}
Is the question clear? Have you some suggestion? Maybe using JS class...or somethings others! let me know, and have a nice time!!!