为什么不能简单地滚动处理这个嵌套div的div?
添加信息
滚动没有完成。单击按钮,不会发生滚动。如果我将div的内容更改为纯文本,则滚动有效。这就是说,simplescroll与嵌套的div及其中的标签有关。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta charset="utf-8">
<title>Simply Scroll</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
<!-- script type="text/javascript" src="http://localhost/jquery/jquery-1.6.2.min.js"></script -->
<link rel="stylesheet" href="http://localhost/jquery/jquery-ui-1.8.16.custom.css">
<!-- script type="text/javascript" src="/simplyscroll/jquery.simplyscroll-1.0.4.js"></script -->
<script type="text/javascript" src="http://simplyscroll.googlecode.com/files/jquery.simplyscroll-1.0.4.min.js"></script>
<link rel="stylesheet" href="/simplyscroll/jquery.simplyscroll-1.0.4.css" media="all" type="text/css">
<script type="text/javascript">
(function($) {
$(function() {
$("#scroller").simplyScroll({
className: 'vert',
horizontal: false,
frameRate: 20,
speed: 5
});
});
})(jQuery);
</script>
</head>
<body>
<div id="scroller">
<div id="u0014" class="comurl"> <img class="dhandle" src="http://www.google.com/s2/favicons?domain=tf1.fr" align="middle" /> <a href="http://tf1.fr" target="_blank" onmouseOver="url_preview('show', this, 'editdiv');" onmouseOut="url_preview('hide', this, 'editdiv');" >TF1.fr</a> <img src="/images/spacer.png" class="spacer" /> <img class="urlbutton" title="Edit" src="/icodeact/Edit16.png" onClick=""/> <img class="urlbutton" title="Delete" src="/icodeact/Delete16.png" onClick="delete_url('u0014');"/>
</div>
<div id="u0015" class="comurl"> <img class="dhandle" src="http://www.google.com/s2/favicons?domain=www.aol.com" align="middle" /> <a href="http://www.aol.com" target="_blank" onmouseOver="url_preview('show', this, 'editdiv');" onmouseOut="url_preview('hide', this, 'editdiv');" >AOL.com</a> <img src="/images/spacer.png" class="spacer" /> <img class="urlbutton" title="Edit" src="/icodeact/Edit16.png" onClick=""/> <img class="urlbutton" src="/icodeact/Delete16.png" onClick="delete_url('u0015');"/>
</div>
<div id="u0016" class="comurl"> <img class="dhandle" src="http://www.google.com/s2/favicons?domain=www.facebook.com" align="middle" /> <a href="http://www.facebook.com" target="_blank" onmouseOver="url_preview('show', this, 'editdiv');" onmouseOut="url_preview('hide', this, 'editdiv');" >Facebook.com</a> <img src="/images/spacer.png" class="spacer" /> <img class="urlbutton" title="Edit" src="/icodeact/Edit16.png" onClick=""/> <img class="urlbutton" src="/icodeact/Delete16.png" onClick="delete_url('u0014');"/>
</div>
<div id="u0017" class="comurl"> <img class="dhandle" src="http://www.google.com/s2/favicons?domain=tf1.fr" align="middle" /> <a href="http://tf1.fr" target="_blank" onmouseOver="url_preview('show', this, 'editdiv');" onmouseOut="url_preview('hide', this, 'editdiv');" >TF1.fr</a> <img src="/images/spacer.png" class="spacer" /> <img class="urlbutton" title="Edit" src="/icodeact/Edit16.png" onClick=""/> <img class="urlbutton" title="Delete" src="/icodeact/Delete16.png" onClick="delete_url('u0014');"/>
</div>
<div id="u0018" class="comurl"> <img class="dhandle" src="http://www.google.com/s2/favicons?domain=www.aol.com" align="middle" /> <a href="http://www.aol.com" target="_blank" onmouseOver="url_preview('show', this, 'editdiv');" onmouseOut="url_preview('hide', this, 'editdiv');" >AOL.com</a> <img src="/images/spacer.png" class="spacer" /> <img class="urlbutton" title="Edit" src="/icodeact/Edit16.png" onClick=""/> <img class="urlbutton" src="/icodeact/Delete16.png" onClick="delete_url('u0015');"/>
</div>
<div id="u0019" class="comurl"> <img class="dhandle" src="http://www.google.com/s2/favicons?domain=www.facebook.com" align="middle" /> <a href="http://www.facebook.com" target="_blank" onmouseOver="url_preview('show', this, 'editdiv');" onmouseOut="url_preview('hide', this, 'editdiv');" >Facebook.com</a> <img src="/images/spacer.png" class="spacer" /> <img class="urlbutton" title="Edit" src="/icodeact/Edit16.png" onClick=""/> <img class="urlbutton" src="/icodeact/Delete16.png" onClick="delete_url('u0014');"/>
</div>
<div id="u0020" class="comurl"> <img class="dhandle" src="http://www.google.com/s2/favicons?domain=tf1.fr" align="middle" /> <a href="http://tf1.fr" target="_blank" onmouseOver="url_preview('show', this, 'editdiv');" onmouseOut="url_preview('hide', this, 'editdiv');" >TF1.fr</a> <img src="/images/spacer.png" class="spacer" /> <img class="urlbutton" title="Edit" src="/icodeact/Edit16.png" onClick=""/> <img class="urlbutton" title="Delete" src="/icodeact/Delete16.png" onClick="delete_url('u0014');"/>
</div>
<div id="u0021" class="comurl"> <img class="dhandle" src="http://www.google.com/s2/favicons?domain=www.aol.com" align="middle" /> <a href="http://www.aol.com" target="_blank" onmouseOver="url_preview('show', this, 'editdiv');" onmouseOut="url_preview('hide', this, 'editdiv');" >AOL.com</a> <img src="/images/spacer.png" class="spacer" /> <img class="urlbutton" title="Edit" src="/icodeact/Edit16.png" onClick=""/> <img class="urlbutton" src="/icodeact/Delete16.png" onClick="delete_url('u0015');"/>
</div>
<div id="u0023" class="comurl"> <img class="dhandle" src="http://www.google.com/s2/favicons?domain=www.facebook.com" align="middle" /> <a href="http://www.facebook.com" target="_blank" onmouseOver="url_preview('show', this, 'editdiv');" onmouseOut="url_preview('hide', this, 'editdiv');" >Facebook.com</a> <img src="/images/spacer.png" class="spacer" /> <img class="urlbutton" title="Edit" src="/icodeact/Edit16.png" onClick=""/> <img class="urlbutton" src="/icodeact/Delete16.png" onClick="delete_url('u0014');"/>
</div>
<div id="u0024" class="comurl"> <img class="dhandle" src="http://www.google.com/s2/favicons?domain=tf1.fr" align="middle" /> <a href="http://tf1.fr" target="_blank" onmouseOver="url_preview('show', this, 'editdiv');" onmouseOut="url_preview('hide', this, 'editdiv');" >TF1.fr</a> <img src="/images/spacer.png" class="spacer" /> <img class="urlbutton" title="Edit" src="/icodeact/Edit16.png" onClick=""/> <img class="urlbutton" title="Delete" src="/icodeact/Delete16.png" onClick="delete_url('u0014');"/>
</div>
<div id="u0025" class="comurl"> <img class="dhandle" src="http://www.google.com/s2/favicons?domain=www.aol.com" align="middle" /> <a href="http://www.aol.com" target="_blank" onmouseOver="url_preview('show', this, 'editdiv');" onmouseOut="url_preview('hide', this, 'editdiv');" >AOL.com</a> <img src="/images/spacer.png" class="spacer" /> <img class="urlbutton" title="Edit" src="/icodeact/Edit16.png" onClick=""/> <img class="urlbutton" src="/icodeact/Delete16.png" onClick="delete_url('u0015');"/>
</div>
<div id="u0026" class="comurl"> <img class="dhandle" src="http://www.google.com/s2/favicons?domain=www.facebook.com" align="middle" /> <a href="http://www.facebook.com" target="_blank" onmouseOver="url_preview('show', this, 'editdiv');" onmouseOut="url_preview('hide', this, 'editdiv');" >Facebook.com</a> <img src="/images/spacer.png" class="spacer" /> <img class="urlbutton" title="Edit" src="/icodeact/Edit16.png" onClick=""/> <img class="urlbutton" src="/icodeact/Delete16.png" onClick="delete_url('u0014');"/>
</div>
<div id="u0028" class="comurl"> <img class="dhandle" src="http://www.google.com/s2/favicons?domain=www.facebook.com" align="middle" /> <a href="http://www.facebook.com" target="_blank" onmouseOver="url_preview('show', this, 'editdiv');" onmouseOut="url_preview('hide', this, 'editdiv');" >Facebook.com</a> <img src="/images/spacer.png" class="spacer" /> <img class="urlbutton" title="Edit" src="/icodeact/Edit16.png" onClick=""/> <img class="urlbutton" src="/icodeact/Delete16.png" onClick="delete_url('u0014');"/>
</div>
<div id="u0029" class="comurl"> <img class="dhandle" src="http://www.google.com/s2/favicons?domain=tf1.fr" align="middle" /> <a href="http://tf1.fr" target="_blank" onmouseOver="url_preview('show', this, 'editdiv');" onmouseOut="url_preview('hide', this, 'editdiv');" >TF1.fr</a> <img src="/images/spacer.png" class="spacer" /> <img class="urlbutton" title="Edit" src="/icodeact/Edit16.png" onClick=""/> <img class="urlbutton" title="Delete" src="/icodeact/Delete16.png" onClick="delete_url('u0014');"/>
</div>
<div id="u0030" class="comurl"> <img class="dhandle" src="http://www.google.com/s2/favicons?domain=www.aol.com" align="middle" /> <a href="http://www.aol.com" target="_blank" onmouseOver="url_preview('show', this, 'editdiv');" onmouseOut="url_preview('hide', this, 'editdiv');" >AOL.com</a> <img src="/images/spacer.png" class="spacer" /> <img class="urlbutton" title="Edit" src="/icodeact/Edit16.png" onClick=""/> <img class="urlbutton" src="/icodeact/Delete16.png" onClick="delete_url('u0015');"/>
</div>
<div id="u0031" class="comurl"> <img class="dhandle" src="http://www.google.com/s2/favicons?domain=www.facebook.com" align="middle" /> <a href="http://www.facebook.com" target="_blank" onmouseOver="url_preview('show', this, 'editdiv');" onmouseOut="url_preview('hide', this, 'editdiv');" >Facebook.com</a> <img src="/images/spacer.png" class="spacer" /> <img class="urlbutton" title="Edit" src="/icodeact/Edit16.png" onClick=""/> <img class="urlbutton" src="/icodeact/Delete16.png" onClick="delete_url('u0014');"/>
</div>
<div id="u0032" class="comurl"> <img class="dhandle" src="http://www.google.com/s2/favicons?domain=www.facebook.com" align="middle" /> <a href="http://www.facebook.com" target="_blank" onmouseOver="url_preview('show', this, 'editdiv');" onmouseOut="url_preview('hide', this, 'editdiv');" >Facebook.com</a> <img src="/images/spacer.png" class="spacer" /> <img class="urlbutton" title="Edit" src="/icodeact/Edit16.png" onClick=""/> <img class="urlbutton" src="/icodeact/Delete16.png" onClick="delete_url('u0014');"/>
</div>
<div id="u0033" class="comurl"> <img class="dhandle" src="http://www.google.com/s2/favicons?domain=tf1.fr" align="middle" /> <a href="http://tf1.fr" target="_blank" onmouseOver="url_preview('show', this, 'editdiv');" onmouseOut="url_preview('hide', this, 'editdiv');" >TF1.fr</a> <img src="/images/spacer.png" class="spacer" /> <img class="urlbutton" title="Edit" src="/icodeact/Edit16.png" onClick=""/> <img class="urlbutton" title="Delete" src="/icodeact/Delete16.png" onClick="delete_url('u0014');"/>
</div>
<div id="u0034" class="comurl"> <img class="dhandle" src="http://www.google.com/s2/favicons?domain=www.aol.com" align="middle" /> <a href="http://www.aol.com" target="_blank" onmouseOver="url_preview('show', this, 'editdiv');" onmouseOut="url_preview('hide', this, 'editdiv');" >AOL.com</a> <img src="/images/spacer.png" class="spacer" /> <img class="urlbutton" title="Edit" src="/icodeact/Edit16.png" onClick=""/> <img class="urlbutton" src="/icodeact/Delete16.png" onClick="delete_url('u0015');"/>
</div>
<div id="u0035" class="comurl"> <img class="dhandle" src="http://www.google.com/s2/favicons?domain=www.facebook.com" align="middle" /> <a href="http://www.facebook.com" target="_blank" onmouseOver="url_preview('show', this, 'editdiv');" onmouseOut="url_preview('hide', this, 'editdiv');" >Facebook.com</a> <img src="/images/spacer.png" class="spacer" /> <img class="urlbutton" title="Edit" src="/icodeact/Edit16.png" onClick=""/> <img class="urlbutton" src="/icodeact/Delete16.png" onClick="delete_url('u0014');"/>
</div>
</div>
</body>
</html>
答案 0 :(得分:0)
找到不同的代码来执行像SimplyScroll一样的连续滚动。
<script type="text/javascript">
$(document).ready(function($) {
$(".scrolling_prev", $("#'.$node['ID'].'")).mousedown(function() {
startScrolling($(".link_drop_box", $("#'.$node['ID'].'")), "-=50px");
}).mouseup(function() {
$(".link_drop_box", $("#'.$node['ID'].'")).stop()
});
$(".scrolling_next", $("#'.$node['ID'].'")).mousedown(function() {
startScrolling($(".link_drop_box", $("#'.$node['ID'].'")), "+=50px");
}).mouseup(function() {
$(".link_drop_box", $("#'.$node['ID'].'")).stop();
});
});
</script>