start to use Mootools for slider effects

This commit is contained in:
Marc Delisle
2008-01-17 13:48:22 +00:00
parent 83606fda0b
commit 2a6119d393
61 changed files with 7228 additions and 1 deletions

View File

@@ -2300,4 +2300,40 @@ function PMA_generate_html_radio($html_field_name, $choices, $checked_choice = '
echo "\n";
}
}
/**
* Generates a slider effect (Mootools)
*
* @uses $GLOBALS['cfg']['InitialSlidersStatus']
* @param string $id the id of the <div> on which to apply the effect
* @param string $message the message to show as a link
*/
function PMA_generate_slider_effect($id, $message) {
?>
<script type="text/javascript">
// <![CDATA[
window.addEvent('domready', function(){
var mySlide<?php echo $id; ?> = new Fx.Slide('<?php echo $id; ?>');
<?php if ($GLOBALS['cfg']['InitialSlidersStatus'] == 'closed') {
?>
mySlide<?php echo $id; ?>.hide();
<?php }
?>
var anchor<?php echo $id; ?> = new Element('a', {
'id': 'toggle_<?php echo $id; ?>',
'href': '#'
});
anchor<?php echo $id; ?>.appendText('<?php echo $message; ?>');
anchor<?php echo $id; ?>.injectBefore($('<?php echo $id; ?>_anchor'));
$('toggle_<?php echo $id; ?>').addEvent('click', function(e){
e = new Event(e);
mySlide<?php echo $id; ?>.toggle();
e.stop();
});
});
// ]]>
</script>
<?php
}
?>