请教高手帮助解决一个问题!
Jun 23, 2016 pm 01:52 PM 这段代码是个弹出框,但是弹出后居于页面的上下左右居中,请问如何定位这个弹出框?比如距离顶部100像素。
function ShowIframe(title,url,w,h)
{
var pop=new Popup({ contentType:1,scrollType:'no',isReloadOnClose:false,width:w,height:h});
pop.setContent("contentUrl",url);
pop.setContent("title",title);
pop.build();
pop.show();
}
上传图片
回复讨论(解决方案)
popup是什么 看样子是某种js插件?
如果是,百度一下应该有使用方法文档的
popup是什么 看样子是某种js插件?
如果是,百度一下应该有使用方法文档的
搜过了,没有找到解决的办法
贴出 Popup 的定义
///******************* popup.js********************/
///修正ie5、ie6、ie7、firefox3.0 兼容问题
///************************************************/
if(!Array.prototype.push){Array.prototype.push=function(){var startLength=this.length;for(var j=0;j
接上楼
style="position:absolute;top:0px;left:0px;width:100%;height:100%;z-index:'+baseZIndex+';'+cB+'background-color:'+this.color.cColor+';display:none;">
'+''+'
| ||||
'+close+' | ||||
接上楼
parseInt(this.oObj.style.top)+25)iTop=iTop+12;this.oObj.style.left=iLeft+"px";this.oObj.style.top=iTop+"px";;if(this.showShadow){G('dialogBoxShadow').style.left=iLeft+this.shadowWidth+"px";G('dialogBoxShadow').style.top=iTop+this.shadowWidth+"px";};this.dragData={x:Event.pointerX(event),y:Event.pointerY(event)};document.body.style.cursor="move";},mouseup:function(event){if(!this.IsDraging)return;if(this.contentType==1)G("iframeBG").style.display="none";document.onmousemove=null;document.onmouseup=null;var mousX=Event.pointerX(event)-(document.documentElement.scrollLeft||document.body.scrollLeft);var mousY=Event.pointerY(event)-(document.documentElement.scrollTop||document.body.scrollTop);var oObjBottom;var oObjRight;if(this.showShadow){oObjBottom=parseInt(this.oObj.style.top)+this.height+this.shadowWidth;oObjRight=parseInt(this.oObj.style.left)+this.width+this.shadowWidth;}else{oObjBottom=parseInt(this.oObj.style.top)+this.height;oObjRight=parseInt(this.oObj.style.left)+this.width;};if(mousXdocument.body.clientWidth||mousY>document.body.clientHeight||parseInt(this.oObj.style.left)document.body.clientWidth||oObjBottom>document.body.clientHeight){this.oObj.style.left=this.backData["x"];this.oObj.style.top=this.backData["y"];if(this.showShadow){G('dialogBoxShadow').style.left=this.backData.x+this.shadowWidth;G('dialogBoxShadow').style.top=this.backData.y+this.shadowWidth;};};this.IsDraging=false;document.body.style.cursor="";Event.stopObserving(document,"selectstart",this.returnFalse,false);},returnFalse:function(){return false;}};function openshow(url,title,w,h,stype){g_pop=new Popup({contentType:stype,isReloadOnClose:false,width:w,height:h});g_pop.setContent("title",title);g_pop.setContent("contentUrl",url);g_pop.build();g_pop.show();}function g_close_pop_re(){g_pop.close();location.reload();}function Comment(url,w,h){g_pop=new Popup({contentType:1,isReloadOnClose:false,width:w,height:h});g_pop.setContent("title","登陆");g_pop.setContent("scrollType","no");g_pop.setContent("contentUrl",url);g_pop.build();g_pop.show();}function g_close_pop(){g_pop.close();g_pop=null;}function ShowAlert(title,content,w,h){var pop=new Popup({contentType:4,isReloadOnClose:false,width:w,height:h});pop.setContent("title",title);pop.setContent("alertCon",content);pop.build();pop.show();}function Wclose(){g_pop.close();g_pop=null;}
直接用Chrome等浏览器的开发者工具来查看Popup生成的HTML,然后直接定义相应的CSS样式就行了。
直接用Chrome等浏览器的开发者工具来查看Popup生成的HTML,然后直接定义相应的CSS样式就行了。
当然,这是暴力方法,但绝对有效。可能Popup插件本身就有定位的方法,但是懒得去研究查找。
那么多Popup插件,没文档不知道换一个插件么?

인기 기사

인기 기사

뜨거운 기사 태그

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

드림위버 CS6
시각적 웹 개발 도구

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)

뜨거운 주제











Win11 시스템에서 중국어 언어 팩을 설치할 수 없는 문제에 대한 해결 방법

Black Shark 휴대폰이 켜지지 않는 문제를 해결하는 방법을 알려주는 5가지 팁!

Xiaohongshu에 게시할 때 사진이 자동으로 저장되는 문제를 해결하는 방법은 무엇입니까? 포스팅 시 자동으로 저장되는 이미지는 어디에 있나요?

이 장치에 드라이버를 로드할 수 없습니다. 어떻게 해결합니까? (개인적으로 테스트되었으며 유효함)
