Solved

make a UL element scrollable

Posted on 2010-11-15
1
881 Views
Last Modified: 2012-05-10
Hello,

I'm having issues making the <ul class="demo2"> below scrollable, is there any way to just make the UL element instead of the entire DIV scrollable?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="jquery.youtubeplaylist.js"></script> 
<script type="text/ecmascript">	
		$(function() {
			$("ul.demo2").ytplaylist({addThumbs:true, autoPlay: false, holderId: 'ytvideo2', allowFullScreen:true});
		});	
</script>
<style type="text/css">
#ytvideo,
#ytvideo2 {
    float: left;
	margin-right:10px;
}
.yt_holder {
    background: #f3f3f3;
    padding: 10px;
    float: left;
    border: 1px solid #e3e3e3;
	margin-bottom:15px;
}
ul {
    float: left;
    margin: 0;
    padding: 0;
    width: 220px;
}
ul li {
    list-style-type: none;
    display:block;
    background: #f1f1f1;
    float: left;
    width: 216px;
    margin-bottom: 5px;
	padding:2px;
}
ul li img {
    width: 120px;
    float: left;
    margin-right: 5px;
    border: 1px solid #999;
}
ul li a {
    font-family: georgia;
    text-decoration: none;
    display: block;
    color: #000;
}
.currentvideo {
	background: #FFCCFF;
}	
</style>
</head>
<body>
	<div id="page">    	 
		<div class="yt_holder">
			<ul class="demo2">
				<li><a href="http://www.youtube.com/watch?v=qqu6DNLKscM">Video 1</a></li>
				<li><a href="http://www.youtube.com/watch?v=qrO4YZeyl0I">Video 2</a></li>
				<li><a href="http://www.youtube.com/watch?v=OihixBV-8pU">Video 3</a></li>
			</ul>
			<div id="ytvideo2"></div>			
		</div>    
    </div>	
</body>
</html>

Open in new window



0
Comment
Question by:cgray1223
[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
1 Comment
 
LVL 18

Accepted Solution

by:
Sudaraka Wijesinghe earned 500 total points
ID: 34142833
set fixed height to the UL and set the CSS overflow like this
ul {
float:left;
margin:0;
padding:0;
width:220px;

height:50px;
overflow-x:hidden;
overflow-y:scroll;
}

Open in new window

0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Validating number not work with decimal 4 46
Change color in a check box 8 37
html5 1 45
isNaN issue on the Table input text 2 42
When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

710 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