您好,我有要求在满足某些条件时打开 Jquery 移动面板的位置我已经尝试关闭、打开面板,但那没有用。请帮忙提前致谢 http://jsfiddle.net/NFkE2/1/
<input id="fieldValue" type="text" name="fieldValue" placeholder="Type in an Value" size="90" />
<a href='#mypanel' onClick='javascript:check();' data-icon="flat-checkround" class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini">submit </a>
<div data-role="panel" id="mypanel" data-position-fixed="true" data-position="left" data-display="overlay" data-theme="d">
This is Panel!
</div>
function check(){
var fieldValue = document.getElementById("fieldValue");
if(fieldValue.value==""){
alert("closing panel");
$( "#mypanel" ).panel( "close" , optionsHash );
}else{
$( "#mypanel" ).panel( "open" , optionsHash );
}
}
最佳答案
使用这段 JavaScript 代码
function check(){
var fieldValue = document.getElementById("fieldValue");
if(fieldValue.value==""){
$( "#mypanel" ).panel( "toggle" );
}
}
关于javascript - 面板打开关闭不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21462423/