這jquery_modal_confirm_dialogue許多實驗後工作。 當我們的觀衆同意我們的使用條款,他們將被重定向到產品頁面products.html放在設置cookie - jquery模式確認對話
我迫切需要設置一個cookie。 - 如果他們不同意,當他們試圖訪問products.html時,此 不可見並再次顯示模式對話框
您能否給我一個提示? (jQuery的1.3.2.min.js)
這是我jqmodal.js
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;
});
});// JavaScript Document
這是我的index.html:
<a href="http://products.html/" class="confirm">Products</a>
<div class="jqmConfirm" id="confirm">
<div id="ex3b" class="jqmConfirmWindow">
<div class="jqmConfirmTitle clearfix">
<h1>Terms of Use</h1>
</div>
<div class="jqmConfirmContent">
<p class="jqmConfirmMsg"></p>
<p>Important legal information</p></div>
<input type="submit" value="Decline" />
<input type="submit" value="Proceed" />
</div>
</div>
請確保你的答案是正確的。 –