Writing /volume1/Web/Public/dokuwiki/data/log/deprecated/2024-11-15.log failed
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
study:javascript:jquery:z-index [2010/10/11 08:57] – banana | study:javascript:jquery:z-index [2010/10/16 10:21] (現在) – banana | ||
---|---|---|---|
行 9: | 行 9: | ||
< | < | ||
<script type=" | <script type=" | ||
+ | <script type=" | ||
<style type=" | <style type=" | ||
- | html, body{ | + | div.sample{ |
- | height: | + | width: 300px; |
- | margin: | + | height: 240px; |
- | } | + | background-color:# |
- | div.sample{ | + | position: |
- | width: 300px; | + | padding: |
- | height: 200px; | + | z-index: |
- | background-color: | + | } |
- | position: absolute; | + | select.sample{ |
- | padding: 10px; | + | z-index: |
- | z-index: 100; | + | position: |
- | } | + | text-align: |
- | select.sample{ | + | border-style: |
- | z-index: 1; | + | border-width: |
- | position: absolute; | + | border-color: |
- | left: | + | } |
- | top: | + | #shim{ |
- | text-align: | + | z-index: |
- | border-style: | + | position: |
- | border-width: | + | visibility: hidden; |
- | border-color: | + | } |
- | } | + | </ |
- | #shim{ | + | <script language=" |
- | z-index: 10; | + | <!-- |
- | position: absolute; | + | $(function(){ |
- | display: none; | + | $("#block").draggable(); |
- | } | + | }); |
- | </ | + | // --> |
- | <script language=" | + | </ |
- | var dragItem = null; | + | |
- | var initEventX, initEventY; | + | |
- | var initLeft, initTop; | + | |
- | // | + | |
- | onload = function | + | |
- | document.documentElement.onmousemove = dragMove; | + | |
- | document.documentElement.onmouseup = dragOff; | + | |
- | } | + | |
- | // | + | |
- | function | + | |
- | var src = e.originalTarget; | + | |
- | if(document.all){ | + | |
- | e = event; | + | |
- | src = e.srcElement; | + | |
- | } | + | |
- | + | ||
- | dragItem = obj; | + | |
- | initEventX = e.screenX; | + | |
- | initEventY = e.screenY; | + | |
- | initLeft = parseInt(dragItem.style.left.replace(' | + | |
- | initTop = parseInt(dragItem.style.top.replace(' | + | |
- | return false; | + | |
- | } | + | |
- | + | ||
- | // | + | |
- | function dragOff(e){ | + | |
- | dragItem = null; | + | |
- | } | + | |
- | + | ||
- | // | + | |
- | function dragMove(e){ | + | |
- | if(document.all)e = event; | + | |
- | if(!e || !dragItem) | + | |
- | return; | + | |
- | + | ||
- | dragItem.style.left = (initLeft + e.screenX - initEventX) + ' | + | |
- | dragItem.style.top = (initTop + e.screenY - initEventY) + ' | + | |
- | + | ||
- | setShim(dragItem); | + | |
- | return false; | + | |
- | } | + | |
- | + | ||
- | // | + | |
- | function setShim(obj){ | + | |
- | var shim = $(' | + | |
- | + | ||
- | // | + | |
- | shim.style.left = obj.style.left; | + | |
- | shim.style.top = obj.style.top; | + | |
- | shim.style.width = obj.offsetWidth; | + | |
- | shim.style.height = obj.offsetHeight; | + | |
- | shim.style.display = 'block'; | + | |
- | } | + | |
- | + | ||
- | // | + | |
- | function $(id){ | + | |
- | // IE5+, Mozilla, Opera | + | |
- | if(document.getElementById) return document.getElementById(id); | + | |
- | if(document.all) return document.all(id); // IE4 | + | |
- | if(document.layers){ // NN4 | + | |
- | var s=''; | + | |
- | for(var i=1; i< | + | |
- | s+=' | + | |
- | return eval(s+' | + | |
- | } | + | |
- | return null; | + | |
- | } | + | |
- | + | ||
- | // --></ | + | |
</ | </ | ||
< | < | ||
<iframe scrolling=" | <iframe scrolling=" | ||
- | <a href=" | + | IE6でselectタグ(プルダウン)がz-indexを無視する対策 |
- | < | + | < |
マウスでドラッグができます。< | マウスでドラッグができます。< | ||
width: | width: | ||
- | height: 200px;<br /> | + | height: 240px;<br /> |
background-color: | background-color: | ||
position: absolute;< | position: absolute;< | ||
padding: 10px;<br /> | padding: 10px;<br /> | ||
< | < | ||
- | left: 100px;<br /> | + | left: 150px;<br /> |
- | top: 100px;<br /> | + | top: 250px;<br /> |
<br /> | <br /> | ||
移動するたびに、setShim関数でこのdivにiframeを重ねています。< | 移動するたびに、setShim関数でこのdivにiframeを重ねています。< | ||
行 137: | 行 69: | ||
</ | </ | ||
</ | </ | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
===== iframe issue ===== | ===== iframe issue ===== | ||
行 143: | 行 102: | ||
===== reference ===== | ===== reference ===== | ||
- [[http:// | - [[http:// | ||
+ | - [[http:// | ||