joshywood
11-06-2006, 01:13 AM
1) Script Title: AJAX Tabs Content
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm
3) Describe problem: I'll try to make this as simple as possible. I've got the AJAX Tabs running fine. I have links within the content area of the tabs that, when clicked, I want to load pictures dynamically using ThickBox.js (If you're not familiar with ThickBox here's the link: http://jquery.com/demo/thickbox/) ThickBox is written in javascript and runs on top of the jQuery library. I realize that external js can be loaded within the AJAX Tabs content area by use of the pollC function (If you're not familiar with the pollC function here's a link: http://www.dynamicdrive.com/forums/showthread.php?t=13003). But as a requirement, the onload events that trigger the external js files you want to use must be known and placed into the pollC script. I'm new to both traditional javascript and jQuery. Can anyone please tell me what onload functions I need from the ThickBox.js and the jQuery.js to place into the pollC script so that I can make this all work? Here are links to the code of ThickBox (http://jquery.com/demo/thickbox/thickbox-code/thickbox.js) and jQuery (http://jquery.com/src/jquery-1.0.2.js). Here's the code for the pollC function:
pollC js function:
<script type="text/javascript">
function pollC(id, load){
if (!load&&document.getElementById(id)){
document.getElementById(id).id='';
return;
}
else if (load&&document.getElementById(id)){
if (id=='unique_1') //optional
onloadfunct(); //required
return;
}
else if (load&&!document.getElementById(id))
setTimeout("pollC('"+id+"', 'load')", 60);
}
</script>
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm
3) Describe problem: I'll try to make this as simple as possible. I've got the AJAX Tabs running fine. I have links within the content area of the tabs that, when clicked, I want to load pictures dynamically using ThickBox.js (If you're not familiar with ThickBox here's the link: http://jquery.com/demo/thickbox/) ThickBox is written in javascript and runs on top of the jQuery library. I realize that external js can be loaded within the AJAX Tabs content area by use of the pollC function (If you're not familiar with the pollC function here's a link: http://www.dynamicdrive.com/forums/showthread.php?t=13003). But as a requirement, the onload events that trigger the external js files you want to use must be known and placed into the pollC script. I'm new to both traditional javascript and jQuery. Can anyone please tell me what onload functions I need from the ThickBox.js and the jQuery.js to place into the pollC script so that I can make this all work? Here are links to the code of ThickBox (http://jquery.com/demo/thickbox/thickbox-code/thickbox.js) and jQuery (http://jquery.com/src/jquery-1.0.2.js). Here's the code for the pollC function:
pollC js function:
<script type="text/javascript">
function pollC(id, load){
if (!load&&document.getElementById(id)){
document.getElementById(id).id='';
return;
}
else if (load&&document.getElementById(id)){
if (id=='unique_1') //optional
onloadfunct(); //required
return;
}
else if (load&&!document.getElementById(id))
setTimeout("pollC('"+id+"', 'load')", 60);
}
</script>