Solved

Vertical Scroll with Links

Posted on 2014-10-08
9
166 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
  • 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 54

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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 54

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 54

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 54

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
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…

776 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