jscrollpane mousewheel event firing only for scrolltrack area in ie/ff

143 views
Skip to first unread message

nirav

unread,
Jan 29, 2011, 7:50:21 AM1/29/11
to jscrollpane
hi..
here is code i am using..mousewheel firing only for scroll track area
not for whole div/iframe..
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="style/
jquery.jscrollpane.css">
<script type="text/javascript" src="script/jquery-1.3.2.js"></script>
<script src="script/jquery.jscrollpane.js"></script>
<script src="script/jquery.mousewheel.js"></script>
<script src="script/jquery.jscrollpane.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#test').jScrollPane({ showArrows:true , scrollbarWidth:5});
});
</script>

</head>

<body>
<div id="test" style="height:300px;width:900px;overflow: auto;">
<iframe style="height:1300px;width:900px;" src="http://www.google.com"
scrolling="no"></iframe>
</div>
</body>
</html>

Kelvin Luck

unread,
Jan 29, 2011, 8:43:14 AM1/29/11
to jscro...@googlegroups.com
Hi,

Unfortunately security restrictions in the browser will prevent you
capturing events from within an iframe in the parent page. This is why
the mousewheel isn't working in your example.

If you have control over the contents of the iframe you can try this
approach:
http://jscrollpane.kelvinluck.com/iframe.html

If you don't have control over the iframe you are stuck with this:
http://jscrollpane.kelvinluck.com/iframe2.html

Which is similar to what you are using (except it dynamically gets the
height of the iframe). As you can see, the mouse wheel won't work with
this approch.

Hope it helps,

Kelvin :)

Reply all
Reply to author
Forward
0 new messages