Front Page "Accordion" Course Menu (video inside)

Re: Front Page "Accordion" Course Menu worked in different way

by Mark Schumann -
Number of replies: 5
Hi Chen,

It seems I missed one important step that I didn't include in the readme. I'll update the file in the next couple of days, but for the moment you'll need to do the following:

In your theme's header.html file, within the <head> tags, include the following code:

<script>
$(document).ready(function(){
$("dd").hide();
$("dt a").click(function(){
if ($(this).parent().next().is(':visible')) {
$(this).parent().next().slideUp("slow");
}
else {
$("dd:visible").slideUp("slow");
$(this).parent().next().slideDown("slow");
}
return false;
});
});
</script>

This should enable the menu animations.

Let me know how you go.

Mark
In reply to Mark Schumann

Re: Front Page "Accordion" Course Menu still not work

by Chen ZhongWei -
Hi, Mark,
I modified the code as you suggested, but it didn't work yet. I checked code in accordion_course_menu files and found that the file " jquery-1.2.6.min.js " is not referenced anywhere.Is that the problem?
Thanks.

Chen
Average of ratings: Useful (1)
In reply to Chen ZhongWei

Re: Front Page "Accordion" Course Menu still not work

by Mark Schumann -
Hi Chen,

Yes that should be referenced as well just above the previous entry in the header.html file, sorry I missed that line myself. Use the code below to replace the code I gave you in my last reply:

<script src="<?php echo $CFG->themewww .'/'. current_theme() ?>/accordion_course_menu/jquery-1.2.6.min.js"></script>
<script>
$(document).ready(function(){
$("dd").hide();
$("dt a").click(function(){
if ($(this).parent().next().is(':visible')) {
$(this).parent().next().slideUp("slow");
}
else {
$("dd:visible").slideUp("slow");
$(this).parent().next().slideDown("slow");
}
return false;
});
});
</script>


In reply to Mark Schumann

Re: Front Page "Accordion" Course Menu working now

by Barry Oosthuizen -
Hi Mark,

I just tried it with the new script added and it works beautifully!

Very cool. Thanks alot.

Barry
In reply to Mark Schumann

Re: Front Page "Accordion" Course Menu work well on FireFox

by Chen ZhongWei -

Thanks Mark,

    It works well on FireFox now. Good idea.Thanks.

    One more issue on IE7.0: course items are seperated with a blank block as high as the course item, where  should be a white line only.

 Chen 

In reply to Chen ZhongWei

Re: Front Page "Accordion" Course Menu work well on FireFox

by Mark Schumann -
That's interesting because it seems to look fine on my IE7. I haven't checked IE6 yet, so there may be issues there. I'll look into it.

I've also updated the archive to include all the latest instructions.

Mark