Solved

Vertical Scroll with Links

Posted on 2014-10-08
9
183 Views
Last Modified: 2014-11-16
Hi, I've attached an image for reference.

In the image you will see that this is going to be a "Veritcally Scrolling Container" - Currently there are no arrows to go between each item, but we can add them in if necessary.

On the left side you see a few links - "Collections Management", "Reporting and Benchmarking", "Charge Capture", "Coding and Compliance" and "Claims Management".

Currently, the screenshot shows what happens if "Charge Capture" were to be clicked. If someone should click on "Collections Management", it should jump to that and show the appropriate content.

If we were to setup arrows, the arrows would simply just jump between links.

I am trying to find an example of how to do this, and I cannot seem to find anything. Any help on this would be great. I have a deadline for the morning on this and I am stumped.

Thank you in advance.
Screen-Shot-2014-10-08-at-4.08.25-PM.png
0
Comment
Question by:Lanmarkian
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
9 Comments
 

Author Comment

by:Lanmarkian
ID: 40369446
Also, there are more links so when it scrolls it has to show more that are hidden.
0
 
LVL 57

Expert Comment

by:Julian Hansen
ID: 40370343
Must the selected link be in the centre always - what happens when you get to the last / first link

Is the section on the right linked to that on the left or does it scroll independently

From what you have told us I understand you want your navigation on the right to scroll so that the select item is in the center - to get to other items top and bottom either would require arrows or sensing the mouse at the top bottom of the container?
0
 

Author Comment

by:Lanmarkian
ID: 40370593
We could just have the navigation scroll. When it gets to the top or the bottom, then it will stop and they can either only go up or down.

The item clicked can stay where it is if need be, but we need at least the content to stay where it is, in the center.

Similar to this: http://www.impressivewebs.com/demo-files/vertical-news-slider/

But I would need the nav on the left to scroll. In fact if the nav on this could scroll, that would be great.
0
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
LVL 57

Accepted Solution

by:
Julian Hansen earned 500 total points
ID: 40372458
How about this
<!doctype html>
<html>
<head>
<title>Test</title>
<style type="text/css">
* {
  padding: 0;
  margin: 0;
}
.box {
  box-sizing: border-box;
}
html, body {
  height: 100%;
}
body {
  font-size: 100%;
}
#wrapper {
  width: 90%;
  margin: 0 auto;
  min-height: 100%;
  overflow: hidden;
  background: lightgray;
}
nav {
  position: fixed;
  width: 15%;
  height: 100%;
  background: #1f2be6;
  overflow: hidden;
}
nav ul {
  list-style: none;
  width: 100%;
  position: absolute;
  top: 0;
}
nav ul li {
  display: inline-block;
  line-height: 100%;
  padding: 0 2em;
  font-size: 22px;
  width: 100%;
}
nav ul li.selected, nav ul li:hover {
  background: #5f6bff;
}
#viewpane {
  width: 85%;
  padding: 2em;
  min-height: 100%;
  margin-left: 15%;
}
</style>
</head>
<body>
<div id="wrapper">
  <nav>
    <ul class="box">
      <li><a href="#page1">Page 1</a></li>
      <li><a href="#page2">Page 2</a></li>
      <li><a href="#page3">Page 3</a></li>
      <li><a href="#page4">Page 4</a></li>
      <li><a href="#page5">Page 5</a></li>
      <li><a href="#page6">Page 6</a></li>
      <li><a href="#page7">Page 7</a></li>
      <li><a href="#page8">Page 8</a></li>
      <li><a href="#page9">Page 9</a></li>
      <li><a href="#page10">Page 10</a></li>
    </ul>
  </nav><div id="viewpane" class="box">
  </div>
</div>
<script src="http://code.jquery.com/jquery.js"></script>
<script type="text/javascript">
$(function() {
  // SET THE NUMBER OF ITEMS IN THE LIST HERE - 
  // THE REST SHOULD AUTOCONFIGURE
  var listitems = 5;
  var totalitems = $('nav ul li').length;
  var median = (listitems - 1) >> 1;
  $('nav ul li:eq(' + median +')').addClass('selected');
  var height = $('#wrapper').height() / listitems;
  $('nav ul li').css({lineHeight : height + 'px'}).height( $('#wrapper').height() / listitems);
  $('nav li').click(function(e) {
    e.preventDefault();
    var current = $(this);
    var offset = Math.max(current.index() - median, 0);
    offset = Math.min(offset, totalitems - listitems);
    $('li.selected').removeClass('selected');
    $('nav ul').animate({
      top: (height * -offset) 
    },750, function() {
      current.addClass('selected');
    });
  });
});
</script>
</body>
</html>

Open in new window

Working sample here http://www.marcorpsa.com/ee/e014.html
0
 

Author Comment

by:Lanmarkian
ID: 40434356
I've requested that this question be closed as follows:

Accepted answer: 0 points for Lanmarkian's comment #a40370593

for the following reason:

test
0
 
LVL 57

Expert Comment

by:Julian Hansen
ID: 40434357
Please advise why you are closing this question accepting your own answer?

I believe a valid answer was provided?
0
 
LVL 57

Expert Comment

by:Julian Hansen
ID: 40444351
As I am the only expert who answered here is my input.

The question was answered as asked and working code was provided.

No follow up to my last post was made.

Author closing comment does not make sense.
0

Featured Post

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question