PDA

View Full Version : ajax tabs help



equalie
04-30-2008, 06:41 AM
1) Script Title: Ajax Tabs Content Script (v 2.2)


2) Script URL (on DD): http://dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm

3) Describe problem:
Im having problems naming the Div container. i used the origional demo div setup and it works but when i try to change the names a little, it changes to a link and doesn't use ajax. heres the script as you can see i named the Div container admindivframe and used the javascript at the end as the same name any help would be great


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="ajaxtabs/ajaxtabs.js">

/***********************************************
* Ajax Tabs Content script v2.2- Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

</script>
<style type="text/css">
<!--
.style3 {font-family: "Dark Crystal"; color: #FFFFFF; }
-->
</style></head>

<body bgcolor="414141">
<table align="center" width="522" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="5" width="522" height="59" background="adminpage/images/forktop.GIF"></tr>
<tr>
<td width="11" rowspan="2" background="adminpage/images/left.jpg" bgcolor="414141">&nbsp;</td>
<ul id="admintabs">
<td height="29" width="166" background="adminpage/images/possbutton.GIF"><a href="admincommands.html" rel="adminframe"><div align="center"><span class="style3">Admin Commands</span></div></a></td>
<td width="167" bordercolor="0" background="adminpage/images/centbutton.GIF"><div align="center"><span class="style3">Want Admin?</span></div></td>
<td width="166" background="adminpage/images/possbutton2.gif"><div align="center"><span class="style3">Admin Abuse</span></div></td>
<td width="11" rowspan="2" background="adminpage/images/right.jpg">&nbsp;</td>
</ul>
</tr>
<tr>
<td width="500" colspan="3" height="300" bgcolor="414141"><div id="admindivframe"><div align="center"><img src="adminpage/images/Image3.gif" /></div>
</div> </td>
</tr>
<tr>
<td colspan="5" ><img src="adminpage/images/forkbottom.gif" width="522" height="59"/></td>
</tr>
</table>

<script type="text/javascript">

var countries=new ddajaxtabs("admintabs", "admindivframe")
countries.setpersist(true)
countries.setselectedClassTarget("link") //"link" or "linkparent"
countries.init()

</script>
</body>
</html>

thanks for the help ~joey~

equalie
04-30-2008, 07:40 PM
oh yeah....http://psychospub.tk is the site where this is located....type admin and then one of the internal tabs

ddadmin
05-01-2008, 02:12 AM
It's a little confusing trying to debug your page, since it's contained in frames. But assuming this is the actual page (http://psychospub.andrevas.net/server/index.html) in question, looking at the source, one problem I see is highlighted in red:


<td width="96" height="25"><a href="#" rel="#default"><img src="images/Home.png" width="96" height="25" border="0" /></a></td>
<td width="78" height="25"><a href="http://96.229.98.240:8080/stats/index.php"><img src="images/Stats.png" width="78" height="25" border="0" /></a></td>

<td width="82" height="25"><img src="images/servers.png" width="82" height="25" /></td>
<td width="237" height="25"><img src="images/index_10.png" width="237" height="25" /></td>
<td width="80" height="25"><a href="admin.html" rel="countrycontainer"><img border="0" src="images/Admin.png" width="80" height="25" /></a></td>
<td width="76" height="25"><img src="images/Links.png" width="76" height="25" /></td>
<td width="99" height="25"><a href="contactiframe.html" rel="countrycontainer"><img src="images/contact.png" width="99" height="25" border="0" /></a></td>
</tr>
</ul>
<tr>
<td width="780" height="4" colspan="9"><img src="images/index_142.PNG" width="780" height="4" /></td>

</tr>
</table>
<Table align="center" width="780" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="22" background="images/index_15L.PNG"></td>
<td width="736"><div style="background:#414141" id="countrydivcontainer"><img src="images/nil.png" width="736" height="1" /></div></td>
<td width="22" background="images/index_15R.PNG"></td>
</tr>
<script type="text/javascript">

var countries=new ddajaxtabs("hometabs", "countrydivcontainer")
countries.setpersist(true)
countries.setselectedClassTarget("link") //"link" or "linkparent"
countries.init()

</script>

The part in red is incorrect- it should point to "countrydivcontainer" instead, or the ID of the DIV that will show the fetched content.