Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

79 lines (73 sloc) 3.195 kb
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>iframe jScrollPane demo</title>
<!-- styles specific to demo site -->
<link type="text/css" href="style/demo.css" rel="stylesheet" media="all" />
<!-- styles needed by jScrollPane - include in your own sites -->
<link type="text/css" href="style/jquery.jscrollpane.css" rel="stylesheet" media="all" />
<style type="text/css" id="page-css">
/* Styles specific to this particular page */
iframe {
width: 100%;
height: 200px;
border: 0;
}
</style>
<!-- latest jQuery direct from google's CDN -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<!-- the mousewheel plugin -->
<script type="text/javascript" src="script/jquery.mousewheel.js"></script>
<!-- the jScrollPane script -->
<script type="text/javascript" src="script/jquery.jscrollpane.min.js"></script>
<!-- scripts specific to this demo site -->
<script type="text/javascript" src="script/demo.js"></script>
<script type="text/javascript" id="sourcecode">
// No page specific javascript - see the sourcecode of the loaded content instead
</script>
</head>
<body>
<div id="top-nav">
<img src="image/logo.png" width="196" height="69" alt="jScrollPane">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="index.html#examples">Examples</a></li>
<li><a href="index.html#themes">Themes</a></li>
<li><a href="index.html#usage">How to use</a></li>
<li><a href="faqs.html">FAQs</a></li>
<li><a href="known_issues.html">Known issues</a></li>
<li><a href="index.html#support">Support</a></li>
<li><a href="index.html#download">Download</a></li>
</ul>
</div>
<div id="container">
<h1>jScrollPane - example with iframes</h1>
<p>
This demonstration shows how you can apply jScrollPane to content in an iframe. Note that in this
demo nothing is done in the hosting page (this one), all of the necessary javascript happens inside
the loaded pages (e.g. <a href="iframe_content1.html">iframe_content1.html</a> and
<a href="iframe_content2.html">iframe_content2.html</a>). Those pages basically use the same technique
as in the <a href="fullpage_scroll.html">full page scroll</a> example.
</p>
<p>
To implement this technique you don't need to add any code to the hosting page but you do need to have
control over the pages which you load into the iframes. And each of those pages will need to include the
relevant script files (e.g. jQuery, jScrollPane etc etc) as well as the document ready script as I show
in my examples.
</p>
<h2>Vertical only</h2>
<iframe src="iframe_content1.html"></iframe>
<h2>Both</h2>
<iframe src="iframe_content2.html"></iframe>
<h2>Page javascript</h2>
<div id="sourcecode-display">
<p>The contents of this div will be replaced by the javascript added to this page</p>
</div>
<h2>Page CSS</h2>
<div id="css-display">
<p>The contents of this div will be replaced by the CSS added to this page</p>
</div>
</div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.