summaryrefslogtreecommitdiff
path: root/inc/html.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2014-12-11 20:51:55 +0100
committerAndreas Gohr <andi@splitbrain.org>2014-12-11 20:51:55 +0100
commit6fa4721ac57074f958b12cf2cf28a489f24e89e1 (patch)
tree4e64e59974dfd3b73e0dfd961c642cd3c7c17658 /inc/html.php
parent4063422b2ff7e6a9d56d7335cfdd2a8c87f49132 (diff)
downloadrpg-6fa4721ac57074f958b12cf2cf28a489f24e89e1.tar.gz
rpg-6fa4721ac57074f958b12cf2cf28a489f24e89e1.tar.bz2
add new behaviour: bounce
Add the class .bounce to any element to let it bounce slightly for 2 seconds. This is useful to make the user aware of some element. Can be combined with #scroll__here when a long list auto scrolls to a certain item.
Diffstat (limited to 'inc/html.php')
-rw-r--r--inc/html.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/inc/html.php b/inc/html.php
index cdcd166d9..87affd47b 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -939,12 +939,16 @@ function html_list_index($item){
function html_li_index($item){
global $INFO;
+ $class = '';
+ $id = '';
+
if($item['type'] == "f"){
// scroll to the current item
if($item['id'] == $INFO['id']) {
$id = ' id="scroll__here"';
+ $class = ' bounce';
}
- return '<li class="level'.$item['level'].'" '.$id.'>';
+ return '<li class="level'.$item['level'].$class.'" '.$id.'>';
}elseif($item['open']){
return '<li class="open">';
}else{