PDA

View Full Version : ddaccordion.js not working when uploaded



redant34
07-08-2008, 10:25 PM
ddaccordion.js not working when uploaded

http://www.dynamicdrive.com/dynamicindex17/ddaccordion_suppliment.htm

on my local drive the two external scripts work and my page works as it should. When I load files onto web server the page does not work, the script does not work. I've tried everything and all the files are uploaded in the same place and paths are good. So I'm not sure why it's not working. My computer is acting as a web server and can only be viewed internally at work.

pls any ideas?

rangana
07-09-2008, 12:00 AM
Please provide a link to the page in question.

redant34
07-09-2008, 02:23 PM
Below is my code the two external scripts dont work when uploaded, but if I embed them they work. Anything wrong with this code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml2/DTD/xhtml1-strict.dtd">
<HTML>
<HEAD><META http-equiv=Content-Type content="text/html; charset=utf-8">
<TITLE>USF Services</TITLE>
<script language="javascript" type="text/javascript" src="jquery-1.2.2.pack.js"></script>

<script language="javascript" type="text/javascript" src="ddaccordion.js">
</script>
<SCRIPT type="text/javascript">
ddaccordion.init({
headerclass: "technology", //Shared CSS class name of headers group
contentclass: "thelanguage", //Shared CSS class name of contents group
revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseover"
collapseprev: false, //Collapse previous content (so only one open at any time)? true/false
defaultexpanded: [0,1,2,3,4], //index of content(s) open by default [index1, index2, etc]. [] denotes no content.
animatedefault: false, //Should contents open by default be animated into view?
persiststate: false, //persist state of opened contents within browser session?
toggleclass: ["closedlanguage", "openlanguage"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
togglehtml: ["prefix", "<img src='images/arrow_closed.gif' /> ", "<img src='images/arrow_open.gif' /> "], //Additional HTML added to the header when it's collapsed and expanded, respectively ["position", "html1", "html2"] (see docs)
animatespeed: "fast", //speed of animation: "fast", "normal", or "slow"
oninit:function(expandedindices){ //custom code to run when headers have initalized
//do nothing
},
onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
//do nothing
}
})
</SCRIPT>
<SCRIPT language=javascript>
function WOpen(pdf)
{
window.open("/portal/pdfs/" + pdf,"","height=400,width=600,top=1,left=1,toolbar=no,menubar=no,scrollbars,resizable");
return false;
}


function openNewWindow(theURL) {
window.open(theURL,'openNewWindow','scrollbars=yes,toolbar=no,status=no,menubar=no,location=no,width=700,height=600,resizable=yes');
return false;
}
</SCRIPT>
<link href="Styles.css" rel="stylesheet" type="text/css">
</HEAD>

ddadmin
07-10-2008, 02:07 AM
Looking at the code you posted, it looks right. The nature of your problem means that we need to see the actual page and interaction between the two scripts if we are to tell what might be the problem.

Amynka
07-14-2009, 08:57 AM
At first it neither worked on my dynamic website, then I realised that in the header part of my template there was another javascript introduced with the tag {literal}{/literal}, so I tried to include this before ddaccordion.init and voila - it worked!

On the other hand I remember I had to separate the CSS part from the general code and put it into an external CSS file, because I already had a stylesheet operating.

I also cut the menu part and put it into an external file - a default category navigation tree, in order to include it properly. This is how HEAD looks like:

<head>
<script type="text/javascript">
{literal}

ddaccordion.init({
headerclass: "headerbar", //Shared CSS class name of headers group
contentclass: "submenu", //Shared CSS class name of contents group
revealtype: "mouseover", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
collapseprev: true, //Collapse previous content (so only one open at any time)? true/false
defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc] [] denotes no content
onemustopen: true, //Specify whether at least one header should be open always (so never all headers closed)
animatedefault: false, //Should contents open by default be animated into view?
persiststate: true, //persist state of opened contents within browser session?
toggleclass: ["", "selected"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
togglehtml: ["", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively ["position", "html1", "html2"] (see docs)
animatespeed: "normal", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
//do nothing
},
onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
//do nothing
}
})

{/literal}
</script>
<link rel=STYLESHEET href="style2.css" type="text/css">


</head>