简称堕天使吧 关注:20,614贴子:1,346,271
  • 8回复贴,共1

【醒目】问一下,吧主是不是对javascript很有研究?我这儿有个问题

取消只看楼主收藏回复

亟待解决的问题。。。一堆代码的问题……调用失败的问题……


IP属地:上海1楼2010-10-11 19:37回复
    - =吧主呢?叉叉呢?


    IP属地:上海3楼2010-10-11 20:09
    回复
      2025-05-21 13:03:12
      广告
      ……orz。所噶。那么对javascript没有研究么。。。还是说我还是把问题在这里说出来比较好?


      IP属地:上海8楼2010-10-12 21:50
      回复
        if(obj.style.background == btnSelected.toLowerCase()) return true; else{ oldColor = obj.style.background; obj.style.background = btnHover; } } function btnMouseOut(obj){ if(obj.style.background == btnSelected.toLowerCase()) return true; obj.style.background = oldColor; } function changePage(obj){ for(i=1;i<footPages.length;i++) footPages[i].style.background = btnColor; obj.style.background = btnSelected; imageList = ''; pageNum = obj.innerHTML.match(/\d+/); if(pageNum != pages){ begin = (pageNum-1)*max; end = pageNum*max - 1; } else{ begin = (pageNum-1)*max; end = imgLinks.length-1; } for(i=begin;i<=end;i++){ imageList += '<div style=\x22border:'+imgBorder+';opacity:'+imgOpacity+';margin:2px;cursor:pointer;width:'+imgWidth+';height:'+imgHeight+';float:left\x22 onmouseover=\x22imgOver(this);\x22 onmouseout=\x22imgOut(this)\x22><table style=\x22width:100%;height:100%\x22><tr><td valign=\x22center\x22 align=\x22center\x22><img style=\x22width:100%\x22 src=\x22' + imgLinks[i] + '\x22 onclick=\x22addFace(this);\x22/></td></tr></table></div>'; } oldDiv = document.getElementById('faceBody'); newDiv = document.createElement('div'); newDiv.id = 'faceBody'; newDiv.setAttribute('style','clear:both;margin-left:1px;margin-top:1px;'); newDiv.innerHTML = imageList; oldDiv.parentNode.replaceChild(newDiv,oldDiv); } function addFace(imgObj){ imgLink = imgObj.src; imgTag = '[img]' + imgLink + '[/img]'; textArea = document.getElementById('message');/*phpbb*/ if(textArea == null || textArea.tagName.toLowerCase() != 'textarea')/*dz7.0.0*/ textArea = document.getElementById('e_textarea'); if(textArea == null || textArea.tagName.toLowerCase() != 'textarea'){/*others*/ textArea = document.getElementsByTagName('textarea'); textArea = textArea[textArea.length-1]; } cursorStart = textArea.selectionStart; cursorEnd = textArea.selectionEnd; textArea.value = textArea.value.slice(0,cursorStart) + imgTag + textArea.value.slice(cursorEnd); textArea.focus(); textArea.selectionStart = cursorStart + imgTag.length; textArea.selectionEnd = cursorEnd + imgTag.length; } function getPageNumWitchZero(num, bit){ var num = '' + num; var zero = '', i = 0; if(num.length >= bit) return num; for(i = 0; i < (bit - num.length); i++){ zero += '0'; } return (zero + num); } window.addEventListener( 'click', function(e){ obj = e.target; while(obj){ if(obj.id && obj.id == 'faceDialog' || obj.nodeName.toLowerCase() == 'textarea') return false; else obj = obj.parentNode; } temp = document.getElementById('faceDialog'); if(temp) temp.parentNode.removeChild(temp); },false ); void(0);
        </script>
        </body>
        </head>
        


        IP属地:上海11楼2010-10-12 22:25
        回复
          'top'){ faceDialog.setAttribute('style','position:fixed;width:428px;background:'+bdColor+';border:'+bdBorder+';z-index:999;left:'+dialogX+'px;top:'+dialogY+'px;'); } function imgOver(obj){ obj.style.border = imgHoverBd; obj.style.opacity = 1; } function imgOut(obj){ obj.style.border = imgBorder; obj.style.opacity = imgOpacity; } function btnMouseOver(obj){ if(obj.style.background == btnSelected.toLowerCase()) return true; else{ oldColor = obj.style.background; obj.style.background = btnHover; } } function btnMouseOut(obj){ if(obj.style.background == btnSelected.toLowerCase()) return true; obj.style.background = oldColor; } function changePage(obj){ for(i=1;i<footPages.length;i++) footPages[i].style.background = btnColor; obj.style.background = btnSelected; imageList = ''; pageNum = obj.innerHTML.match(/\d+/); if(pageNum != pages){ begin = (pageNum-1)*max; end = pageNum*max - 1; } else{ begin = (pageNum-1)*max; end = imgLinks.length-1; } for(i=begin;i<=end;i++){ imageList += '<div style=\x22border:'+imgBorder+';opacity:'+imgOpacity+';margin:2px;cursor:pointer;width:'+imgWidth+';height:'+imgHeight+';float:left\x22 onmouseover=\x22imgOver(this);\x22 onmouseout=\x22imgOut(this)\x22><table style=\x22width:100%;height:100%\x22><tr><td valign=\x22center\x22 align=\x22center\x22><img style=\x22width:100%\x22 src=\x22' + imgLinks[i] + '\x22 onclick=\x22addFace(this);\x22/></td></tr></table></div>'; } oldDiv = document.getElementById('faceBody'); newDiv = document.createElement('div'); newDiv.id = 'faceBody'; newDiv.setAttribute('style','clear:both;margin-left:1px;margin-top:1px;'); newDiv.innerHTML = imageList; oldDiv.parentNode.replaceChild(newDiv,oldDiv); } function addFace(imgObj){ imgLink = imgObj.src; imgTag = '[img]'%20+%20imgLink%20+%20'[/img]'; textArea = document.getElementById('message');/*phpbb*/ if(textArea == null || textArea.tagName.toLowerCase() != 'textarea')/*dz7.0.0*/ textArea = document.getElementById('e_textarea'); if(textArea == null || textArea.tagName.toLowerCase() != 'textarea'){/*others*/ textArea = document.getElementsByTagName('textarea'); textArea = textArea[textArea.length-1]; } cursorStart = textArea.selectionStart; cursorEnd = textArea.selectionEnd; textArea.value = textArea.value.slice(0,cursorStart) + imgTag + textArea.value.slice(cursorEnd); textArea.focus(); textArea.selectionStart = cursorStart + imgTag.length; textArea.selectionEnd = cursorEnd + imgTag.length; } window.addEventListener( 'click', function(e){ obj = e.target; while(obj){ if(obj.id && obj.id == 'faceDialog' || obj.nodeName.toLowerCase() == 'textarea') return false; else obj = obj.parentNode; } temp = document.getElementById('faceDialog'); if(temp) temp.parentNode.removeChild(temp); },false ); void(0);</script>>
          </head>
          


          IP属地:上海13楼2010-10-12 22:27
          回复
            = =度娘把那啥给那啥了。于是10楼没有了。于是断层了。


            IP属地:上海14楼2010-10-12 22:30
            回复
              12楼也消失了。很快都会消失的。嗯。


              IP属地:上海15楼2010-10-12 22:31
              回复
                回复:17楼
                = =
                因为该代码原本不是用于网页内部的。所以分了行缩了进就失效了。
                以上,以上而已。
                另外……其实确实是“看个p啊”,被度熊活生生吞了一半,已经根本没法看了。


                IP属地:上海18楼2010-10-13 14:58
                回复
                  2025-05-21 12:57:12
                  广告
                  回复:16楼
                  所噶……囧。。。。。。好吧谢谢……


                  IP属地:上海19楼2010-10-13 14:58
                  回复