共计 1091 个字符,预计需要花费 3 分钟才能阅读完成。
magento在目录页中,想要访问各个页,需要点数字,如何用户想手工输入页面数,实现自行跳转
如图:
简单的代码即可实现
/app/design/frontend/default/default/template/page/html/pager.phtml中增加一个简单的代码即可实现
代码如下:
<li style=
"width:65px;border:0px;margin-left:-5px"
class
=
"next-icon"
>
<form onsubmit=
"return true;"
class
=
"custom_form"
action=
""
name=
"p"
method=
"get"
>
<input type=
"text"
value=
""
name=
"p"
class
=
"custom_page"
style=
"width:20px;"
>
<input type=
"submit"
class
=
"custom_form_submit"
onclick=
"submitCustomPages(this);"
value=
"Go"
name=
"submit"
>
</form>
<script type=
"text/javascript"
>
function
submitCustomPages(self){
var
inputValue = jQuery.trim(jQuery(self).prev().val());
if
(inputValue && !isNaN(inputValue)){
var
vv = parseInt(inputValue);
}
else
{
alert(
"Please enter a number"
);
return
false;
}
return
ture;
}
</script>
</li>
加到合适的地方即可!
正文完