PDA

View Full Version : different scripts with jQuery



yaron
08-20-2011, 08:54 PM
1) Script Title:

2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex2/sagscroller.htm

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

3) Describe problem:

I try to use two of the scripts above in one page and one of them didn't work, i figured that the problem is because both scripts are using jQuery lib,
please help, anyone knows how can i fix it?

:confused:

here is the code:


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="animatedcollapse.js">

/***********************************************
* Animated Collapsible DIV v2.4- (c) 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 this script and 100s more
***********************************************/

</script>


<script type="text/javascript">

animatedcollapse.addDiv('cat', 'fade=0,speed=400,group=pets,hide=1')
animatedcollapse.addDiv('dog', 'fade=0,speed=400,group=pets,hide=1')
animatedcollapse.addDiv('rabbit', 'fade=0,speed=400,group=pets,hide=1')


animatedcollapse.ontoggle=function($, divobj, state){ //fires each time a DIV is expanded/contracted
//$: Access to jQuery
//divobj: DOM reference to DIV being expanded/ collapsed. Use "divobj.id" to get its ID
//state: "block" or "none", depending on state
}

animatedcollapse.init()

</script>


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="sagscroller.js">

/***********************************************
* SAG Content Scroller- 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
***********************************************/

</script>
<script>

//SAG scroller #1:

var sagscroller1=new sagscroller({
id:'mysagscroller',
mode: 'manual' //<--no comma following last option
})


</script>

jscheuer1
08-20-2011, 09:08 PM
Change the first one as shown:


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript" src="animatedcollapse.js">

/***********************************************
* Animated Collapsible DIV v2.4- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUS . . .

And get rid of the second highlighted one:


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="sagscroller.js">

/***********************************************
* SAG Content Scroller- Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must s . . .

That should do it. But there also could be other problems. If you want more help:

Please post a link to a page on your site that contains the problematic code so we can check it out.

yaron
08-21-2011, 08:26 AM
Thank you so much John!!!
it works great now!

thanks
yaron