Writing /volume1/Web/Public/dokuwiki/data/log/deprecated/2024-11-15.log failed
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
study:javascript:jquery:z-index [2010/10/11 09:10] – banana | study:javascript:jquery:z-index [2010/10/16 10:21] (現在) – banana | ||
---|---|---|---|
行 9: | 行 9: | ||
< | < | ||
<script type=" | <script type=" | ||
+ | <script type=" | ||
<style type=" | <style type=" | ||
div.sample{ | div.sample{ | ||
width: | width: | ||
- | height: 250px; | + | height: 240px; |
background-color:# | background-color:# | ||
position: | position: | ||
行 32: | 行 33: | ||
} | } | ||
</ | </ | ||
- | <script language=" | + | <script language=" |
- | var dragItem = null; | + | <!-- |
- | var initEventX, initEventY; | + | $(function(){ |
- | var initLeft, initTop; | + | $("# |
- | + | }); | |
- | // | + | |
- | | + | |
- | $(document).mousemove(function(e){dragMove(e); | + | |
- | | + | |
- | }); | + | |
- | // | + | |
- | function dragOn(obj, e){ | + | |
- | 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 = ' | + | |
- | } | + | |
// --> | // --> | ||
</ | </ | ||
行 94: | 行 44: | ||
<iframe scrolling=" | <iframe scrolling=" | ||
IE6でselectタグ(プルダウン)がz-indexを無視する対策 | 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: 50px;<br /> | + | left: 150px;<br /> |
top: 250px;< | top: 250px;< | ||
<br /> | <br /> | ||
行 125: | 行 75: | ||
\\ | \\ | ||
\\ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
行 147: | 行 102: | ||
===== reference ===== | ===== reference ===== | ||
- [[http:// | - [[http:// | ||
+ | - [[http:// | ||