Solved

Vertical Scroll with Links

Posted on 2014-10-08
9
179 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
javascript duplicates 9 25
Natural height and jquery 6 40
drop down menu blocks search boxes 4 23
Javascript not to let an input enter more or less 4 11
How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
This article discusses how to implement server side field validation and display customized error messages to the client.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

734 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