Solved

Vertical Scroll with Links

Posted on 2014-10-08
9
162 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 52

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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 52

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 52

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 52

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
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)

910 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now