Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- var active_page_id = 4;
- function getPosition(id)
- {
- switch(id)
- {
- case 1:
- return position = "321px";
- break;
- case 2:
- return position = "407px";
- break;
- case 3:
- return position = "496px";
- break;
- case 4:
- return position = "556px";
- break;
- case 5:
- return position = "619px";
- break;
- default:
- //
- }
- }
- function slideOver(id)
- {
- $("#top_menu_arrow").stop().animate({
- left: getPosition(id)
- }, 700);
- }
- function slideBack()
- {
- $("#top_menu_arrow").stop().animate({
- left: getPosition(active_page_id)
- }, 700);
- }
- $(document).ready(function() {
- // initiate active section in menu
- slideOver(active_page_id);
- });
- </script>
- usage:
- <a href="#" onMouseOver="slideOver(5)" onMouseOut="slideBack()" />
Add Comment
Please, Sign In to add comment