Skip to content
Snippets Groups Projects
Commit 6fa4721a authored by Andreas Gohr's avatar Andreas Gohr
Browse files

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.
parent 4063422b
No related branches found
No related tags found
No related merge requests found
...@@ -939,12 +939,16 @@ function html_list_index($item){ ...@@ -939,12 +939,16 @@ function html_list_index($item){
function html_li_index($item){ function html_li_index($item){
global $INFO; global $INFO;
$class = '';
$id = '';
if($item['type'] == "f"){ if($item['type'] == "f"){
// scroll to the current item // scroll to the current item
if($item['id'] == $INFO['id']) { if($item['id'] == $INFO['id']) {
$id = ' id="scroll__here"'; $id = ' id="scroll__here"';
$class = ' bounce';
} }
return '<li class="level'.$item['level'].'" '.$id.'>'; return '<li class="level'.$item['level'].$class.'" '.$id.'>';
}elseif($item['open']){ }elseif($item['open']){
return '<li class="open">'; return '<li class="open">';
}else{ }else{
......
...@@ -56,6 +56,8 @@ var dw_behaviour = { ...@@ -56,6 +56,8 @@ var dw_behaviour = {
jQuery(document).on('click','#page__revisions input[type=checkbox]', jQuery(document).on('click','#page__revisions input[type=checkbox]',
dw_behaviour.revisionBoxHandler dw_behaviour.revisionBoxHandler
); );
jQuery('.bounce').effect('bounce', {times:10}, 2000 );
}, },
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment