Results 1 to 5 of 5

Thread: ddaccordion.js not working when uploaded

  1. #1
    Join Date
    Jul 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default ddaccordion.js not working when uploaded

    ddaccordion.js not working when uploaded

    http://www.dynamicdrive.com/dynamici...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?

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Please provide a link to the page in question.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  3. #3
    Join Date
    Jul 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default accordion external scripts not working

    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>

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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.

  5. #5
    Join Date
    Jul 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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>

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •