繁体   English   中英

创建页面的模式窗口加载以供用户反馈

[英]Creating a modal window onload of a page for user feedback

我必须创建一个模式窗口以显示弹出窗口或模式窗口,以获取用户对我们Intranet的反馈。 该窗口应该有一个复选框,上面写着“不要再问这个问题”。 我尝试使用jquery创建此窗口,但我不知道该怎么做。 我什至试图用谷歌搜索它,但没有得到正确的答案。 谁能帮我这个忙。 我是jquery的新手。我看到许多网站都在其中创建了模式窗口,但它们使用php,但我做不到。 为此,请使用jquery,jsp或javascript代码帮助我。 随附了用例文档的屏幕截图。 任何帮助表示赞赏。 提前致谢。 ps我正在使用Websphere Portal。

抱歉,该图片不允许。

下面提到的代码也可以完成工作。 请帮助。

    <html>
<head>
<%@page session="false" contentType="text/html" pageEncoding="ISO-8859-1" import="java.util.*,javax.portlet.*,com.ibm.accessitservicesfeedbackpopup.*" %>
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>        
<%@taglib uri="http://www.ibm.com/xmlns/prod/websphere/portal/v6.1/portlet-client-model" prefix="portlet-client-model" %>        
<portlet:defineObjects/>
<link rel="stylesheet" type="text/css" href="<%= renderRequest.getContextPath() %>/style.css"/>
<link rel="stylesheet" type="text/css" href="<%= renderRequest.getContextPath() %>/jqModal.css"/>
<script language="javascript" type="text/javascript" src="<%= renderRequest.getContextPath() %>/jqModal.js"></script>
<script language="javascript" type="text/javascript">
function confirm(msg,callback) {
  $('#confirm')
    .jqmShow()
    .find('p.jqmConfirmMsg')
      .html(msg)
    .end()
    .find(':submit:visible')
      .click(function(){
        if(this.value == 'yes')
          (typeof callback == 'string') ?
            window.location.href = callback :
            callback();
        $('#confirm').jqmHide();
      });
}


$().ready(function() {
  $('#confirm').jqm({overlay: 88, modal: true, trigger: false});

  // trigger a confirm whenever links of class alert are pressed.
  $('a.confirm').click(function() { 
    confirm('About to visit: '+this.href+' !',this.href); 
    return false;
  });
});
</script>
</head>
<body>
<a href="#" class="jqModal">view</a> (confirm)

<!-- Confirm Dialog -->
<div class="jqmWindow" id="confirm">

<div id="ex3b" class="jqmConfirmWindow">
    <div class="jqmConfirmTitle clearfix">
    <a href="#" class="jqmClose"><em>Close</em></a>
  </div>

  <div class="jqmConfirmContent">
  <p class="jqmConfirmMsg"></p>
  <p>Continue?</p>
  </div>

  <input type="submit" value="no" />
  <input type="submit" value="yes" />

</div>

</div>

</body>
</html> 

您可以使用一个漂亮的jQuery对话框。 只需下载jQuery和jQuery ui(包括js和css)并包含到您的项目中即可。 它完全可以正常工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM