http://plus.uc.cn/document/bookmarks/mobileHelp.html 界面效果类似:
示例代码:
//替换下iframe里的url就好.
function addUCWeb(){
this.DoUCWeb=function(){
var userAgent=navigator.userAgent.toLowerCase();
if(userAgent&&userAgent.match(/android/i)&&userAgent.match(/ucbrowser/i)){
var newElement = document.createElement('iframe');
newElement.setAttribute('src', 'http://app.uc.cn/appstore/AppCenter/frame?uc_param_str=nieidnutssvebipfcp&id=346');
newElement.setAttribute('style', 'display:none;width:0;height:0;border:0;');
document.getElementById('ifUc').appendChild(newElement);
}
}
this.addUCNav=function(){
var newElement = document.createElement('iframe');
newElement.setAttribute('id', 'iframeUc');
newElement.setAttribute('frameborder', '0');
newElement.setAttribute('marginheight', '0');
newElement.setAttribute('marginwidth', '0');
newElement.setAttribute('src', 'http://app.uc.cn/appstore/AppCenter/frame?uc_param_str=nieidnutssvebipfcp&id=346');
newElement.setAttribute('style', 'width:100%;height:100%;border:none;position: fixed;top: 0;z-index: 3000;');
document.body.appendChild(newElement);
}
this.receiveMessage=function(event){
//console.log(JSON.stringify(event.data));
if(event.data.message=='success'||event.data.message=='close'||event.data.message=='cancle'){
var iframeUc=document.getElementById('iframeUc');
document.body.removeChild(iframeUc);
}else{
var ifUc=document.getElementById('ifUc');
var iframeUc=ifUc.childNodes[0];
ifUc.removeChild(iframeUc);
if(event.data.message!='already exist'){
this.addUCNav();
}
}
}
window.addEventListener("message",this.receiveMessage,false);
this.DoUCWeb();
}
addUCWeb();