PDA

View Full Version : Anylink Drop down menu help



Charina
03-07-2007, 04:05 AM
1) Script Title: Any link drop down menu

2) Script URL (on DD): http://dynamicdrive.com/dynamicindex1/dropmenuindex.htm

3) Describe problem: I must be staring at this script too long because I can't see the error. I am not very knowledgable and could use some help. The only part that was edited was the links themselves, however the drop down is not working.

<script type="text/javascript">

/***********************************************
* AnyLink Drop Down Menu- Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="http://www.cherryadair.com">Cherry Adair</a>'
menu1[1]='<a href="http://www.shelleybradley.com">Shelley Bradley</a>'
menu1[2]='<a href="http://206.67.55.177/">Tori Carrington</a>'
menu1[3]='<a href="http://www.pamelaclare.com">Pamela Clare</a>'
menu1[4]='<a href="http://www.jennifercrusie.com/">Jennifer Crusie</a>'
menu1[5]='<a href="http://www.sylviaday.com">Sylvia Day</a>'
menu1[6]='<a href="http://www.jacquied.com/">Jacquie D'Alessandro</a>'
menu1[7]='<a href="http://www.annawrites.com">Anna DeStefano</a>'
menu1[8]='<a href="http://www.theheathergraham.com">Shannon Drake</a>'
menu1[9]='<a href="http://www.gaelenfoley.com">Gaelen Foley</a>'
menu1[10]='<a href="http://www.doriegraham.com">Dorie Graham</a>'
menu1[11]='<a href="http://www.theheathergraham.com">Heather Graham</a>'
menu1[12]='<a href="http://www.kristinhardy.com">Kristin Hardy</a>'
menu1[13]='<a href="http://www.sandrahill.net">Sandra Hill</a>'
menu1[14]='<a href="http://www.cherylholt.com">Cheryl Holt</a>'
menu1[15]='<a href="http://www.eloisajames.com">Eloisa James</a>'
menu1[16]='<a href="http://www.sabrinajeffries.com">Sabrina Jeffries</a>'
menu1[17]='<a href="http://www.susanjohnsonauthor.com/index.html">Susan Johnson</a>'
menu1[18]='<a href="http://www.nicolejordanauthor.com/">Nicole Jordan</a>'
menu1[19]='<a href="http://www.brendajoyce.com">Brenda Joyce</a>'
menu1[20]='<a href="http://www.stephanielaurens.com">Stephanie Laurens</a>'
menu1[21]='<a href="http://www.joleigh.com">Jo Leigh</a>'
menu1[22]='<a href="http://www.julieleto.com">Julie Leto</a>'
menu1[23]='<a href="http://www.karenmoning.com/index2.html">Karen Marie Moning</a>'
menu1[24]='<a href="http://www.robinschone.com">Robin Schone</a>'
menu1[25]='<a href="http://juliaquinn.com">Julia Quinn</a>'

//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<a href="http://tristabane.blogspot.com">Trista Bane</a>'
menu2[1]='<a href="http://debbiebehrens.blogspot.com/">Debbie Behrens</a>'
menu2[2]='<a href="http://womenoflivingwater.blogspot.com/">Corina Bowen</a>'
menu2[3]='<a href="http://www.shelleybradley.com/blog/">Shelley Bradley</a>'
menu2[4]='<a href="http://tjbrown.blogspot.com/">TJ Brown</a>'
menu2[5]='<a href="http://charinamiranda.blogspot.com/">Char's Blog</a>'
menu2[6]='<a href="http://robinswritingworld.blogspot.com/">Robin Caroll</a>'
menu2[7]='<a href="http://chryscasey.blogspot.com/">Chrystal Casey</a>'
menu2[8]='<a href="http://www.sylviaday.com/blog/">Sylvia Day</a>'
menu2[9]='<a href="http://annadestefano.blogspot.com/">Anna DeStefano</a>'
menu2[10]='<a href="http://dianedishman.blogspot.com/">Diane Dishman</a>'
menu2[11]='<a href="http://thewritesnark.blogspot.com/">Rinda Elliot</a>'
menu2[12]='<a href="http://melissafrancis.blogspot.com/">Mel Francis</a>'
menu2[13]='<a href="http://www.bonnieferguson.com/blog/">Bonnie Ferguson</a>'
menu2[14]='<a href="http://heathersblethers.blogspot.com/">Heather Dawn Harper</a>'
menu2[15]='<a href="http://cnn.com">CNN</a>'
menu2[16]='<a href="http://nienkehinton.blogspot.com/">Nienke Hinton</a>'
menu2[17]='<a href="http://cert-romantic.livejournal.com/">Amanda Jayde</a>'
menu2[18]='<a href="http://judsonknight.blogspot.com/">Judson Knight</a>'
menu2[19]='<a href="http://www.amandamccabe.blogspot.com/">Amanda McCabe</a>'
menu2[20]='<a href="http://grosvenorsquare.blogspot.com/">Melissa Marsh</a>'
menu2[21]='<a href="http://elvenvampires.blogspot.com/">Merleena's Blog</a>'
menu2[22]='<a href="http://www.patricemichelle.net/blog/2006/05/22/back-from-rt/">Patrice Michelle</a>'
menu2[23]='<a href="http://jillmonroe.blogspot.com/">Jill Monroe</a>'
menu2[24]='<a href="http://marniemyers.blogspot.com/">Marnie Myers</a>'
menu2[25]='<a href="http://alittlecheesewiththatwhine.blogspot.com/">Rene's Blog</a>'
menu2[26]='<a href="http://dishinthedirt.blogspot.com/">Betty Sanders</a>'
menu2[27]='<a href="http://justwritesara.blogspot.com/">Sara's Blog</a>'
menu2[28]='<a href="http://genashowalter.blogspot.com/">Gena Showalter</a>'
menu2[29]='<a href="http://marywritesromance.blogspot.com/">The Bandwagon</a>'
menu2[30]='<a href="http://www.cafepress.com/TheWriteSnark/">The Write Snark</a>'
menu2[31]='<a href="http://urbanfantasy.blogspot.com/">Rachel Vincent</a>'

var menuwidth='165px' //default menu width
var menubgcolor='990000' //menu bgcolor
var disappeardelay=250 //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

<a href="default1.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu1, '150px')" onMouseout="delayhidemenu()"><font size=3>Favorite Authors</font></a> <a href="default2.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu2, '150px')" onMouseout="delayhidemenu()"><font size=3>Blogroll</font></a>

thetestingsite
03-07-2007, 04:09 AM
I spot a few problems, and they have to do with single quotes not being escaped. Look at the below code (in red) and use that to fix your issue.



<script type="text/javascript">

/***********************************************
* AnyLink Drop Down Menu- &#169; Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="http://www.cherryadair.com">Cherry Adair</a>'
menu1[1]='<a href="http://www.shelleybradley.com">Shelley Bradley</a>'
menu1[2]='<a href="http://206.67.55.177/">Tori Carrington</a>'
menu1[3]='<a href="http://www.pamelaclare.com">Pamela Clare</a>'
menu1[4]='<a href="http://www.jennifercrusie.com/">Jennifer Crusie</a>'
menu1[5]='<a href="http://www.sylviaday.com">Sylvia Day</a>'
menu1[6]='<a href="http://www.jacquied.com/">Jacquie D\' Alessandro</a>'
menu1[7]='<a href="http://www.annawrites.com">Anna DeStefano</a>'
menu1[8]='<a href="http://www.theheathergraham.com">Shannon Drake</a>'
menu1[9]='<a href="http://www.gaelenfoley.com">Gaelen Foley</a>'
menu1[10]='<a href="http://www.doriegraham.com">Dorie Graham</a>'
menu1[11]='<a href="http://www.theheathergraham.com">Heather Graham</a>'
menu1[12]='<a href="http://www.kristinhardy.com">Kristin Hardy</a>'
menu1[13]='<a href="http://www.sandrahill.net">Sandra Hill</a>'
menu1[14]='<a href="http://www.cherylholt.com">Cheryl Holt</a>'
menu1[15]='<a href="http://www.eloisajames.com">Eloisa James</a>'
menu1[16]='<a href="http://www.sabrinajeffries.com">Sabrina Jeffries</a>'
menu1[17]='<a href="http://www.susanjohnsonauthor.com/index.html">Susan Johnson</a>'
menu1[18]='<a href="http://www.nicolejordanauthor.com/">Nicole Jordan</a>'
menu1[19]='<a href="http://www.brendajoyce.com">Brenda Joyce</a>'
menu1[20]='<a href="http://www.stephanielaurens.com">Stephanie Laurens</a>'
menu1[21]='<a href="http://www.joleigh.com">Jo Leigh</a>'
menu1[22]='<a href="http://www.julieleto.com">Julie Leto</a>'
menu1[23]='<a href="http://www.karenmoning.com/index2.html">Karen Marie Moning</a>'
menu1[24]='<a href="http://www.robinschone.com">Robin Schone</a>'
menu1[25]='<a href="http://juliaquinn.com">Julia Quinn</a>'

//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<a href="http://tristabane.blogspot.com">Trista Bane</a>'
menu2[1]='<a href="http://debbiebehrens.blogspot.com/">Debbie Behrens</a>'
menu2[2]='<a href="http://womenoflivingwater.blogspot.com/">Corina Bowen</a>'
menu2[3]='<a href="http://www.shelleybradley.com/blog/">Shelley Bradley</a>'
menu2[4]='<a href="http://tjbrown.blogspot.com/">TJ Brown</a>'
menu2[5]='<a href="http://charinamiranda.blogspot.com/">Char\'s Blog</a>'
menu2[6]='<a href="http://robinswritingworld.blogspot.com/">Robin Caroll</a>'
menu2[7]='<a href="http://chryscasey.blogspot.com/">Chrystal Casey</a>'
menu2[8]='<a href="http://www.sylviaday.com/blog/">Sylvia Day</a>'
menu2[9]='<a href="http://annadestefano.blogspot.com/">Anna DeStefano</a>'
menu2[10]='<a href="http://dianedishman.blogspot.com/">Diane Dishman</a>'
menu2[11]='<a href="http://thewritesnark.blogspot.com/">Rinda Elliot</a>'
menu2[12]='<a href="http://melissafrancis.blogspot.com/">Mel Francis</a>'
menu2[13]='<a href="http://www.bonnieferguson.com/blog/">Bonnie Ferguson</a>'
menu2[14]='<a href="http://heathersblethers.blogspot.com/">Heather Dawn Harper</a>'
menu2[15]='<a href="http://cnn.com">CNN</a>'
menu2[16]='<a href="http://nienkehinton.blogspot.com/">Nienke Hinton</a>'
menu2[17]='<a href="http://cert-romantic.livejournal.com/">Amanda Jayde</a>'
menu2[18]='<a href="http://judsonknight.blogspot.com/">Judson Knight</a>'
menu2[19]='<a href="http://www.amandamccabe.blogspot.com/">Amanda McCabe</a>'
menu2[20]='<a href="http://grosvenorsquare.blogspot.com/">Melissa Marsh</a>'
menu2[21]='<a href="http://elvenvampires.blogspot.com/">Merleena\'s Blog</a>'
menu2[22]='<a href="http://www.patricemichelle.net/blog/2006/05/22/back-from-rt/">Patrice Michelle</a>'
menu2[23]='<a href="http://jillmonroe.blogspot.com/">Jill Monroe</a>'
menu2[24]='<a href="http://marniemyers.blogspot.com/">Marnie Myers</a>'
menu2[25]='<a href="http://alittlecheesewiththatwhine.blogspot.com/">Rene\'s Blog</a>'
menu2[26]='<a href="http://dishinthedirt.blogspot.com/">Betty Sanders</a>'
menu2[27]='<a href="http://justwritesara.blogspot.com/">Sara's Blog</a>'
menu2[28]='<a href="http://genashowalter.blogspot.com/">Gena Showalter</a>'
menu2[29]='<a href="http://marywritesromance.blogspot.com/">The Bandwagon</a>'
menu2[30]='<a href="http://www.cafepress.com/TheWriteSnark/">The Write Snark</a>'
menu2[31]='<a href="http://urbanfantasy.blogspot.com/">Rachel Vincent</a>'

var menuwidth='165px' //default menu width
var menubgcolor='990000' //menu bgcolor
var disappeardelay=250 //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

<a href="default1.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu1, '150px')" onMouseout="delayhidemenu()"><font size=3>Favorite Authors</font></a> <a href="default2.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu2, '150px')" onMouseout="delayhidemenu()"><font size=3>Blogroll</font></a>


Hope this helps.

Charina
03-07-2007, 04:19 AM
Thank you so much! I'm new at this and it's hard to pin point the errors. What's obvious to some is like greek to me. The only problem I see now is that when you hover over the drop down, it's not expanding underneath the heading. It's all so confusing to me...



I spot a few problems, and they have to do with single quotes not being escaped. Look at the below code (in red) and use that to fix your issue.



<script type="text/javascript">

/***********************************************
* AnyLink Drop Down Menu- &#169; Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="http://www.cherryadair.com">Cherry Adair</a>'
menu1[1]='<a href="http://www.shelleybradley.com">Shelley Bradley</a>'
menu1[2]='<a href="http://206.67.55.177/">Tori Carrington</a>'
menu1[3]='<a href="http://www.pamelaclare.com">Pamela Clare</a>'
menu1[4]='<a href="http://www.jennifercrusie.com/">Jennifer Crusie</a>'
menu1[5]='<a href="http://www.sylviaday.com">Sylvia Day</a>'
menu1[6]='<a href="http://www.jacquied.com/">Jacquie D\' Alessandro</a>'
menu1[7]='<a href="http://www.annawrites.com">Anna DeStefano</a>'
menu1[8]='<a href="http://www.theheathergraham.com">Shannon Drake</a>'
menu1[9]='<a href="http://www.gaelenfoley.com">Gaelen Foley</a>'
menu1[10]='<a href="http://www.doriegraham.com">Dorie Graham</a>'
menu1[11]='<a href="http://www.theheathergraham.com">Heather Graham</a>'
menu1[12]='<a href="http://www.kristinhardy.com">Kristin Hardy</a>'
menu1[13]='<a href="http://www.sandrahill.net">Sandra Hill</a>'
menu1[14]='<a href="http://www.cherylholt.com">Cheryl Holt</a>'
menu1[15]='<a href="http://www.eloisajames.com">Eloisa James</a>'
menu1[16]='<a href="http://www.sabrinajeffries.com">Sabrina Jeffries</a>'
menu1[17]='<a href="http://www.susanjohnsonauthor.com/index.html">Susan Johnson</a>'
menu1[18]='<a href="http://www.nicolejordanauthor.com/">Nicole Jordan</a>'
menu1[19]='<a href="http://www.brendajoyce.com">Brenda Joyce</a>'
menu1[20]='<a href="http://www.stephanielaurens.com">Stephanie Laurens</a>'
menu1[21]='<a href="http://www.joleigh.com">Jo Leigh</a>'
menu1[22]='<a href="http://www.julieleto.com">Julie Leto</a>'
menu1[23]='<a href="http://www.karenmoning.com/index2.html">Karen Marie Moning</a>'
menu1[24]='<a href="http://www.robinschone.com">Robin Schone</a>'
menu1[25]='<a href="http://juliaquinn.com">Julia Quinn</a>'

//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<a href="http://tristabane.blogspot.com">Trista Bane</a>'
menu2[1]='<a href="http://debbiebehrens.blogspot.com/">Debbie Behrens</a>'
menu2[2]='<a href="http://womenoflivingwater.blogspot.com/">Corina Bowen</a>'
menu2[3]='<a href="http://www.shelleybradley.com/blog/">Shelley Bradley</a>'
menu2[4]='<a href="http://tjbrown.blogspot.com/">TJ Brown</a>'
menu2[5]='<a href="http://charinamiranda.blogspot.com/">Char\'s Blog</a>'
menu2[6]='<a href="http://robinswritingworld.blogspot.com/">Robin Caroll</a>'
menu2[7]='<a href="http://chryscasey.blogspot.com/">Chrystal Casey</a>'
menu2[8]='<a href="http://www.sylviaday.com/blog/">Sylvia Day</a>'
menu2[9]='<a href="http://annadestefano.blogspot.com/">Anna DeStefano</a>'
menu2[10]='<a href="http://dianedishman.blogspot.com/">Diane Dishman</a>'
menu2[11]='<a href="http://thewritesnark.blogspot.com/">Rinda Elliot</a>'
menu2[12]='<a href="http://melissafrancis.blogspot.com/">Mel Francis</a>'
menu2[13]='<a href="http://www.bonnieferguson.com/blog/">Bonnie Ferguson</a>'
menu2[14]='<a href="http://heathersblethers.blogspot.com/">Heather Dawn Harper</a>'
menu2[15]='<a href="http://cnn.com">CNN</a>'
menu2[16]='<a href="http://nienkehinton.blogspot.com/">Nienke Hinton</a>'
menu2[17]='<a href="http://cert-romantic.livejournal.com/">Amanda Jayde</a>'
menu2[18]='<a href="http://judsonknight.blogspot.com/">Judson Knight</a>'
menu2[19]='<a href="http://www.amandamccabe.blogspot.com/">Amanda McCabe</a>'
menu2[20]='<a href="http://grosvenorsquare.blogspot.com/">Melissa Marsh</a>'
menu2[21]='<a href="http://elvenvampires.blogspot.com/">Merleena\'s Blog</a>'
menu2[22]='<a href="http://www.patricemichelle.net/blog/2006/05/22/back-from-rt/">Patrice Michelle</a>'
menu2[23]='<a href="http://jillmonroe.blogspot.com/">Jill Monroe</a>'
menu2[24]='<a href="http://marniemyers.blogspot.com/">Marnie Myers</a>'
menu2[25]='<a href="http://alittlecheesewiththatwhine.blogspot.com/">Rene\'s Blog</a>'
menu2[26]='<a href="http://dishinthedirt.blogspot.com/">Betty Sanders</a>'
menu2[27]='<a href="http://justwritesara.blogspot.com/">Sara's Blog</a>'
menu2[28]='<a href="http://genashowalter.blogspot.com/">Gena Showalter</a>'
menu2[29]='<a href="http://marywritesromance.blogspot.com/">The Bandwagon</a>'
menu2[30]='<a href="http://www.cafepress.com/TheWriteSnark/">The Write Snark</a>'
menu2[31]='<a href="http://urbanfantasy.blogspot.com/">Rachel Vincent</a>'

var menuwidth='165px' //default menu width
var menubgcolor='990000' //menu bgcolor
var disappeardelay=250 //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

<a href="default1.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu1, '150px')" onMouseout="delayhidemenu()"><font size=3>Favorite Authors</font></a> <a href="default2.htm" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu2, '150px')" onMouseout="delayhidemenu()"><font size=3>Blogroll</font></a>


Hope this helps.