js 드래그 가능한 배경 인터페이스_페이지 배경

WBOY
풀어 주다: 2016-05-16 19:02:19
원래의
1019명이 탐색했습니다.

// ************************ 드래그 ********************** * **********
function setDrag(e){
var drag_flag = true
var start_x = getX(e)
//마스크 추가
createMask( );
                                                                                                                                                                            🎜>        반품(예: x || e.clientX);                        > ;
var _height = $doc("dragBar").offsetHeight "px";;

var SplitDivCss="position:absolute;width:6px;height:" _height ";top:" _top " ;left:" _left ";cursor:col-
resize; background-color:#cccccc;overflow :hidden;z-index:10010;filter:alpha(opacity=50);opacity:0.5;";
var _splitDiv = document.createElement("div");
_splitDiv.id = "splitDiv";
_splitDiv.style.cssText = SplitDivCss;

document.body.appendChild(_splitDiv);

}
function createMask(){
            try{
// 배경 만들기
Var Rootel = Document.documentlement ||
VAR; DOCHEIGHT = (Rootel.Clientheight & GT; Rootel.Scrollheight)?
rootl.Clientheight: rootl.Scrollheight) " px"
var docWidth=((rootEl.clientWidth>rootEl.scrollWidth)?rootEl.clientWidth: rootEl.scrollWidth)
"px";
var var
shieldStyle="위치: 절대;top :0px;left:0px;width:" docWidth ";height:" docHeight ";배경:#cccccc ;z-
index:10000;filter:alpha(opacity=0);opacity:0";
var _shield = document.createElement("div");
_shield.id = "shield";
_shield.style.cssText = ShieldStyle;
docu ment.body.appendChild(_shield)
                        catch(e){}
}
//드래그 시 실행되는 함수
document.onmousemove = function(e){
try{
if(drag_flag){
            var now_x = getX(e)
var _pv; =parseInt($doc("splitDiv").style.left)now_x -begin_x;
$doc("splitDiv").style.left = _pv "px";
Begin_x = now_x; else{                                                                                                                              Child($doc("shield"));
              document.body.removeChild($doc("splitDiv"));                                             나이()

document.onmouseup = function(){
시도{
if(drag_flag){
width)
$doc("leftShow").style.width = $doc("splitDiv").style.left
document.body .removeChild($doc("shield"));
document.body.removeChild ($doc("splitDiv"));
                                                                          drag_flag=false ){}
}

}

if(window.attachEvent){
window.attachEvent("onload",function(){resizePage();});
      window.attachEvent("onresize", function() {resizePage();}); resizePage();},true);
window.addEventListener("resize",function(){resizePage();},true);


[Ctrl A 모두 선택 참고: 외부 J를 도입해야 하는 경우 실행하려면 새로 고쳐야 합니다
]
관련 라벨:
js
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
최신 이슈
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!