TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 728
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 377
  • Total: 377

Accordion Style Menu Block

Started by Megaforum, October 20, 2007, 05:23:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dannbass

The thing is that when you open the site the first tab will drop... so people will have that effect and will know that those will move... just look at http://www.dzinerstudio.com/ and eye effect.

I think is very useful... just need to know how to put php there... ;)

bluedevil

What if they open when hovering instead of clicking?

lebisol

Quote from: bluedevil on October 22, 2007, 10:34:16 PM
What if they open when hovering instead of clicking?
You would be forcing users to point their mouse Very carefully as menues would start to fly arround

Rus

I think a click would be fine if it showed as a link

Hairy


Zetan

Quote from: dannbass on October 22, 2007, 10:25:48 PM
The thing is that when you open the site the first tab will drop... so people will have that effect and will know that those will move... just look at http://www.dzinerstudio.com/ and eye effect.


It works well on dzinerstudio site.  8)

Dragooon

If you want PHP there is A small difference, And Yes it is very possible.
Here is an example
Put this in a PHP Block add

global $context, $settings, $options, $scripturl, $txt, $user_info, $modSettings;

// The Style.css and the Javascripts.
echo '
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">


.toggler {
color: #222;
margin: 0;
padding: 2px 5px;
background: #eee;
border-bottom: 1px solid #ddd;
border-right: 1px solid #ddd;
border-top: 1px solid #f5f5f5;
border-left: 1px solid #f5f5f5;
font-size: 11px;
font-weight: normal;
font-family: \'Andale Mono\', sans-serif;
}

.element {

}

.element p {
margin: 0;
padding: 4px;
}

.float-right {
padding:10px 20px;
float:right;
}

blockquote {
text-style:italic;
padding:5px 0 5px 30px;
}


</style>
<script type="text/javascript" src="mootools-accordion.js"></script>

<script type="text/javascript">
window.onload = function() {
var accordion = new Accordion(\'h3.atStart\', \'div.atStart\', {
opacity: false,
onActive: function(toggler, element){
toggler.setStyle(\'color\', \'#ff3300\');
},

onBackground: function(toggler, element){
toggler.setStyle(\'color\', \'#222\');
}
}, $(\'accordion\'));

}
</script>
</head>
<body>';
//Now the actual Blocks begain
echo '
<div id="accordion">
<h3 class="toggler atStart">Example 1</h3>
<div class="element atStart">';
echo'
               test
</div>
</div>
</body>
</html>';

Please note: This won't work on a Script Box, It MUST be a PHP Block as it is modified to be in PHP.
The code on first post is ONLY for a Script box.

Dragooon

Quote from: Zetan on October 23, 2007, 07:31:42 AM
Quote from: dannbass on October 22, 2007, 10:25:48 PM
The thing is that when you open the site the first tab will drop... so people will have that effect and will know that those will move... just look at http://www.dzinerstudio.com/ and eye effect.


It works well on dzinerstudio site.  8)
Someone requested this and pointed to that site, So thats how I got inspired to make this ;).

dannbass

Yes and it is pretty cool!! Thanks a lot for the php version!! and for posting it here!!

Dragooon


This website is proudly hosted on Crocweb Cloud Website Hosting.