Forum Moderators: open
Only two displayed out of fifteen (eventually) using this code:
function randomorder(targetarray, spacing)
{
var randomorder=new Array()
var the_one
var z=0
for (i=0;i<targetarray.length;i++)
randomorder[i]=i
//while (z<targetarray.length){
while (z<2){
the_one=Math.floor(Math.random()*targetarray.length)
if (targetarray[the_one]!="_selected!"){
document.write(targetarray[the_one]+spacing)
targetarray[the_one]="_selected!"
z++
}
}
}
var content=new Array()
content[0]='<p>"The best B & B we‘ve stayed in!"<p><span>John & Maggie, Australia</span></p>'
content[1]='<p>"Wonderful stay, great breakfast"<p><span>Helen & David, Exeter</span></p>'
content[2]='<p>"View to die for"<p><span>Joe & Jane, Barcelona</span></p>'
called from:
<div id="sidebarTestimonials">
<h3>Testimonials</h3>
<script type="text/javascript">randomorder(content, '')</script>
</div>
(The span is there for trying to fix the IE problem, I thought it was the double quotes for a p class.)
Works fine in Firefox.
I also have CSS:
#navList li a:hover,
#navList li a:active ,
body#home a#homeNav,
body#details a#detailsNav,
body#rooms a#roomsNav,
body#availability a#availabilityNav,
body#contact a#contactNav {
background: url(/images/bg_navHover.jpg);
color: inherit;
}
Comment out the above, IE6 and 7 display the two testimonials correctly.
But when active, only the final paragraph is displayed when I hover over a nav item, although sometimes it works.
What might be going on here?