zvucini
asked on
javascript scrolling on click event
This is the code:
<img src="images/scrolldown.gif " onClick="frames['iframe']. scrollBy(0 ,50)" >
'iframe' is some name of iframe that i want to scroll when image is clicked.
What i need is to scroll iframe when mouse button is pressed and while is pressed it should scroll for 50 px, until mouse is released. When it's released it should stop scroll.
I tried some loop but it doesn't work.
<img src="images/scrolldown.gif
'iframe' is some name of iframe that i want to scroll when image is clicked.
What i need is to scroll iframe when mouse button is pressed and while is pressed it should scroll for 50 px, until mouse is released. When it's released it should stop scroll.
I tried some loop but it doesn't work.
ASKER
No, what i need is continuous scrolling od iframe until mouse is released. Now, it's scrolling only once.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Great!
Best regards,
Zoran
Best regards,
Zoran
ASKER
Perfect!
Best regards
Best regards
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<style type="text/css">
html,body{height:100%;}
body{background:#dee;}
div#divOne{margin:50px;hei
</style>
<script type="text/javascript">
function hi(){
document.getElementById('d
}
</script>
</head>
<body onmouseup="if(window.sI)cl
<div id="divOne" onmousedown="sI=setInterva
</div>
<div id="divTwo">
</div>
</body>
</html>