The problem of mailbox jumping in js or jQuery, jumping to the specified mailbox (implemented by iframe of layui)

 

Take notes on what you just made

If you encounter the same problem and solve the problem, please leave a message

 

var emailtext = $("#TextBoxEmail").val();//Get the value to be intercepted
var arr = emailtext.split("@");//Intercept email string
var emailtype = arr[1];// Email Type
//*******QQ Email********//
if (emailtype == "qq.com") {
layer.msg('Sending email', {
time: 10000, //Wait time
//If the server does not respond within 20 seconds, jump to the error page
icon: 16, shade: 0.01
}),
setTimeout(function () {
layer.msg('Mail sent successfully', { icon: 6 } );
//layer.msg('Mail sending failed', {icon: 5});
setTimeout(function () {
// ****The input is QQ mailbox*****//
layer.open({
type: 2,
title: false,
closeBtn: 0, //Do not display the close button
shade: [0],
area: ['340px', '215px'],
offset: 'rb',//The lower right corner pops up
time: 2000, //automatically closes after 2 seconds
anim: 2,
content: ['Transition/QQEmail.html', 'no'], //iframe的url,no代表不显示滚动条
end: function () { //此处用于演示
layer.open({
type: 2,
title: '很多时候,我们想最大化看,比如像这个页面。',
shadeClose: true,
shade: false,
maxmin: true, //开启最大化最小化按钮
area: ['1050px', '670px'],
content: 'https://mail.qq.com/'
});
}
});
}, 1000);
}, 10000);
}
//*******QQ邮箱结束********//
//*******NSU邮箱********//
if (arr == "nsu.edu.cn") {
layer.msg('正在发送邮件', {
time: 10000,//等待时间
//如果20秒内服务器无响应,跳转到错误页面
icon: 16, shade: 0.01
}),
setTimeout(function () {
layer.msg('邮件发送成功', { icon: 6 });
//layer.msg('邮件发送失败', {icon: 5});
setTimeout(function () {

layer.open({
type: 2,
title: false,
closeBtn: 0, //不显示关闭按钮
shade: [0],
area: ['340px', '215px'],
offset: 'rb', //右下角弹出
time: 2000, //2秒后自动关闭
anim: 2,
content: ['Transition/NSUEmail.html', 'no'], //iframe的url,no代表不显示滚动条
end: function () { //此处用于演示
layer.open({
type: 2,
title: '很多时候,我们想最大化看,比如像这个页面。',
shadeClose: true,
shade: false,
maxmin: true, //开启最大化最小化按钮
area: ['1050px', '670px'],
content: 'https://mail.nsu.edu.cn/'
});
}
});
}, 1000);
}, 10000);
}
//*******NSU邮箱结束********//

//*******163邮箱********//
if (emailtype == "163.com") {
layer.msg('正在发送邮件', {
time: 10000,//等待时间
//如果20秒内服务器无响应,跳转到错误页面
icon: 16, shade: 0.01
}),
setTimeout(function () {
layer.msg('邮件发送成功', { icon: 6 });
//layer.msg('邮件发送失败', {icon: 5});
setTimeout(function () {

layer.open({
type: 2,
title: false,
closeBtn: 0, //不显示关闭按钮
shade: [0],
area: ['340px', '215px'],
offset: 'rb', //右下角弹出
time: 2000, //2秒后自动关闭
anim: 2,
content: ['Transition/163Email.html', 'no'], //iframe的url,no代表不显示滚动条
end: function () { //此处用于演示
layer.open({
type: 2,
title: '很多时候,我们想最大化看,比如像这个页面。',
shadeClose: true,
shade: false,
maxmin: true, //开启最大化最小化按钮
area: ['1050px', '670px'],
content: 'https://mail.163.com/'
});
}
});
}, 1000);
}, 10000);
}
//*******163邮箱结束********//

//*******Outlook邮箱********//
if (emailtype == "outlook.com") {
layer.msg('正在发送邮件', {
time: 10000,//等待时间
//如果20秒内服务器无响应,跳转到错误页面
icon: 16, shade: 0.01
}),
setTimeout(function () {
layer.msg('邮件发送成功', { icon: 6 });
//layer.msg('邮件发送失败', {icon: 5});
setTimeout(function () {

layer.open({
type: 2,
title: false,
closeBtn: 0, //不显示关闭按钮
shade: [0],
area: ['340px', '215px'],
offset: 'rb', //右下角弹出
time: 2000, //2秒后自动关闭
anim: 2,
content: ['Transition/OutlookEmail.html', 'no'], //iframe的url,no代表不显示滚动条
end: function () { //此处用于演示
layer.open({
type: 2,
title: '很多时候,我们想最大化看,比如像这个页面。',
shadeClose: true,
shade: false,
maxmin: true, //开启最大化最小化按钮
area: ['1050px', '670px'],
content: 'https://outlook.live.com/owa/'
});
}
});
}, 1000);
}, 10000);
}
//*******Outlook邮箱结束********//

//*******新浪邮箱********//没有考虑新浪VIP邮箱
if (emailtype == "sina.com") {
layer.msg('正在发送邮件', {
time: 10000,//等待时间
//如果20秒内服务器无响应,跳转到错误页面
icon: 16, shade: 0.01
}),
setTimeout(function () {
layer.msg('邮件发送成功', { icon: 6 });
//layer.msg('邮件发送失败', {icon: 5});
setTimeout(function () {

layer.open({
type: 2,
title: false,
closeBtn: 0, //不显示关闭按钮
shade: [0],
area: ['340px', '215px'],
offset: 'rb', //右下角弹出
time: 2000, //2秒后自动关闭
anim: 2,
content: ['Transition/SinaEmail.html', 'no'], //iframe的url,no代表不显示滚动条
end: function () { //此处用于演示
layer.open({
type: 2,
title: '很多时候,我们想最大化看,比如像这个页面。',
shadeClose: true,
shade: false,
maxmin: true, //开启最大化最小化按钮
area: ['1050px', '670px'],
content: 'https://mail.sina.com.cn/'
});
}
});
}, 1000);
}, 10000);
}
//*******新浪邮箱结束********//
//*******如果输入了系统不支持的邮箱********//
if (emailtype != "qq.com" && emailtype != "163.com" && emailtype != "sina.com" && emailtype != "outlook.com" && emailtype != "nsu.edu.cn") {
//邮箱不支持提示框
layer.confirm('抱歉.目前本系统不支持该邮箱', {
icon: 5,
btn: ['好吧'] //按钮
}, function(){
layer.msg('以后一定支持');
//在这里清空不支持的email,^-^目前没实现??????
$("#TextBoxEmail").val() = "";
});

}

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324730447&siteId=291194637