View Full Version : Resolved ddaccordion won't work with jqModal

05-01-2008, 03:26 PM
1) Script Title: ddaccordion

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ddaccordion.htm

3) Describe problem: I have the jqModal plug-in on my website as well. when I put in ddaccordion it stops working and I get this error in firebug.

$ is not a function

05-01-2008, 06:39 PM
DD Accordion relinquishes the "$" function so another JS framework on your same page (if any) can claim and use it as it desires. This is to avoid conflicts with frameworks that also use "$", such as Prototype etc. Now, if jqModal (or any other jQuery script) on the same page don't take into consideration the above set up and dives straight into using "$", you'll have to manually reclaim "$" for jQuery. In other words, you can add the below to the first line within the jqModal script:


05-01-2008, 09:41 PM

thank you for your help!

05-08-2009, 07:12 AM
Just like the thread starter,

Hello, Im getting the ff error:
$("#ex4a").jqm is not a function

but $=jQuery.noConflict() did not work for me :(

Im using the ff libs:

<script type="text/javascript" src="js/jquery-1.2.6.pack.js"></script>
<script type="text/javascript" src="js/jqModal.js"></script>
<script type="text/javascript" src="js/jqDnR.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="ddaccordion.js">

* Accordion Content script- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use


Here's my script on the <--head-->

<script type="text/javascript">

$().ready(function() {


trigger: '#ex4aTrigger',
overlay: 50, /* 0-100 (int) : 0 is off/transparent, 100 is opaque */
overlayClass: 'whiteOverlay'})
.jqDrag('.jqDrag'); /* make dialog draggable, assign handle to title */

// Close Button Highlighting. IE doesn't support :hover. Surprise?
function(){ $(this).addClass('jqmdXFocus'); },
function(){ $(this).removeClass('jqmdXFocus'); })
function(){ this.hideFocus=true; $(this).addClass('jqmdXFocus'); })
function(){ $(this).removeClass('jqmdXFocus'); });


//Initialize first demo:
headerclass: "mypets", //Shared CSS class name of headers group
contentclass: "thepet", //Shared CSS class name of contents group
revealtype: "click", //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: false, //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: ["", "openpet"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
togglehtml: ["none", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively ["position", "html1", "html2"] (see docs)
animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "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

I tried adding the code $=jQuery.noConflict(); like this:

(function($) {


Thanks :)