This website can use cookies to improve the user experience

This website can use cookies to improve the user experience and to provide certain services and functions to users. Cookies contain small amounts of information (such as login information and user preferences) and will be stored on your device.

Enable All Cookies Privacy Policy

Collapsable side blocks


avatar
Fred Sherman 15
From: -
Collapsable DHTML animated side blocks as seen here:  http://www.power-systems.com

Put collapse.png and expand.png in your images directory

Unzip and put animatedcollapse.js in your jscripts/jquery directory

Modify templates:
Templates » Default » site » site_menu_header (your may not be Default)
HTML Part
Before:
<ul class="navlist">


Add:
</script>
<script type="text/javascript" src="https://www.contentteller.com//jscripts/jquery/jquery.min.js"></script>
<script type="text/javascript" src="https://www.contentteller.com//jscripts/jquery/animatedcollapse.js"></script>
<script type="text/javascript">
animatedcollapse.ontoggle=function($, divobj, state){ //fires each time a DIV is expanded/contracted
}
animatedcollapse.init()

</script>


Submit

Templates » Default » site » site_block
HTML Part:
Replace with:
<script type="text/javascript">
animatedcollapse.addDiv('{$blockname}', 'fade=1,persist=1')
</script
<!-- Template: site_block -->
<h1>
<a href="#" rel="toggle[{$blockname}]" data-openimage="/images/collapse.png" data-closedimage="/images/expand.png"><img src="https://www.contentteller.com//images/collapse.png" border="0" style="margin-right:5px"/></a>
{$insert['block_name']}</h1>
<div class="content" id="{$blockname}">
{$insert['block_content']}
</div>

<br />


PHP Part:
Add:
$sPattern = '/\s*/m';
$sReplace = '';
$blockname = preg_replace( $sPattern, $sReplace, $insert['block_name'] );

Submit
Expand
Collapse
   animatedcollapse.zip

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.

Responses to this topic


1 Re: Collapsable side blocks
avatar
12
From: -
Hmm nice modification. Thank you.
1 Re: Collapsable side blocks
avatar
Administrator
1340
From: Vienna, Austria
Very nice Smiling Face

jQuery is already loaded in site_header. There is no need for:
<script type="text/javascript" src="https://www.contentteller.com//jscripts/jquery/jquery.min.js"></script>

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.