我面临的问题是我的调查中有一系列问题。第一个问题要求用户点击复选框,如果他不是成员。如果用户选中复选框,则光标应该自动滚动到页面的底部,跳过所有后面的问题。滚动到页面底部
我已经尝试过使用jquery的不同功能,但都没有工作。 这是我以前试过(P.S也没有这项工作)的代码
<?php
if(!stristr($_SERVER['PHP_SELF'],"printSummary")) {
require_once("../lib/include/common.inc.php");
} else {
require_once("../../lib/include/common.inc.php");
}
ob_start();
$node_id = $parentnode?$parentnode:getDataFromSession("data,node_id");
$node_name = get_node_name($node_id,$_SESSION["survey"],$_SESSION['idLink']);
$surveyForText = getText2("This survey is for:")." ".$node_name;
if(strlen($node_name)>0) {
echo "<script type='text/javascript'>";
echo "$(document).ready(function(){";
echo "$('.generalErrorMsg').first().addClass('generalErrorMsgWithMargin').text(\"$surveyForText\");";
echo "});";
echo "</script>";
}
//code that I am talking about starts here
$currentPageNum = currentPageNumber();
if($currentPageNum==4)
{
echo "<script type=\"text/javascript\">
$(document).ready(function(){
$('input[type=checkbox]').click(function() {
alert('here');
setTimeout(function() {
window.scrollTo(0, 1) },100);
});
//window.scrollBy(100,100); // horizontal and vertical scroll increments
//scrolldelay = setTimeout('pageScroll()',80); // scrolls every 80 milliseconds
});";
echo "</script>";
}
?>
请帮我解决代码。在此先感谢 -Jathin
我应该只添加这行代码? – Jathin 2012-07-30 11:57:50
检查更新的答案。 – 2012-07-30 12:02:16
让我检查一下。给我一分钟 – Jathin 2012-07-30 12:06:15