熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

asp.net 中實現窗體兩邊的浮動條

2013-11-13 10:01:05  來源: .NET編程 

  javascript 

  第一個

   <SCRIPT src=js/showjs></SCRIPT>

  showjs代碼如下

  /*** *   對聯廣告代碼DI (Double Images)

  *   by Moky @ //*/ DI_sLeftImageUrl   = _//jpgDI_sRightImageUrl   = _//jpgDI_sClickUrl      = DI_sImageUrl      = DI_iImageWidth      = parseInt(if (isNaN(DI_iImageWidth)) DI_iImageWidth = DI_iImageHeight   = parseInt(if (isNaN(DI_iImageHeight)) DI_iImageHeight =

  DI_iMinWindowWidth = + DI_iImageWidth *    /* avoid covering the web content */ DI_iTop   = DI_iLeft = DI_iRight = DI_iTimeout =

  DI_blClosed = false/*—— common codes begin ——*/ var __bs__ = navigatoruserAgentindexOf(MSIE) >

  MSIE navigatoruserAgentindexOf(Safari) >

  Safari othersvar __dt__ = (documentdocumentElementclientHeight > ) &&(__bs__ == MSIE || documentbodyclientHeight > documentdocumentElementclientHeight) ?

  WC undefinedfunction MK_pageY() { if (__bs__ == MSIE) { if (__dt__ == WC

  return documentdocumentElementscrollTopelse return documentbodyscrollTop} else { return windowpageYOffset} function MK_pageX() { if (__bs__ == MSIE) { if (__dt__ == WC

  return documentdocumentElementscrollLeftelse return documentbodyscrollLeft} else { return windowpageXOffset} function MK_pageH() { if (__bs__ == Safari

  return windowinnerHeightelse if (__dt__ == WC

  return documentdocumentElementclientHeightelse return documentbodyclientHeight} function MK_pageW() { if (__bs__ == Safari

  return windowinnerWidthelse if (__dt__ == WC

  return documentdocumentElementclientWidthelse return documentbodyclientWidth} function MK_posY(o v) { if (!o || !ostyle) return if (v) { ostyletop = parseInt(v) + px} else { return ostyletop} function MK_posX(o v) { if (!o || !ostyle) return if (v) { ostyleleft = parseInt(v) + px} else { return ostyleleft}

  function MK_makeAdFodderHTML(sImageUrl sImageName iWidth iHeight) { var _src = sImageUrl == ? sImageName sImageUrlreturn (!_srcmatch(/\swf$/gi)? <img src=$src$ height= width= border= /> <object classid=clsidDCDBEAEDcfB + codebase=#version= + height= width=>\n + <param name=movie value=$src$ />\n + <param name=quality value=high />\n + <param name=wmode value=opaque />\n + <embed height= width= + src=$src$ quality=high wmode=opaque + type=application/xshockwaveflash pluginspace=> + </embed> + </object>replace(/\$src\$/gi _src)replace(/\$height\$/gi iHeight)replace(/\$width\$/gi iWidth)} /*—— common codes end ——*/ function closead() { DI_blClosed = trueDI_Hide()}

  function DI_Hide() { try { documentgetElementById(DI_LDivstyledisplay = nonedocumentgetElementById(DI_RDivstyledisplay = none} catch(e) {} }

  function JsCloseDAD() { closead()return false }

  function DI_Show() { if (DI_blClosed) returntry { documentgetElementById(DI_LDivstyledisplay = blockdocumentgetElementById(DI_RDivstyledisplay = block} catch(e) {} }

  function DI_Load() { var style_class /*   try { if (__bs__ == MSIE

  documentstyleSheets[]addRule(div_floating_ad positionabsoluteelse documentstyleSheets[]insertRule(div_floating_ad {positionabsolute} documentstyleSheets[]cssRuleslength)style_class = class=div_floating_ad } catch(e) {*/ style_class = /*   }*/ var _temp = <div id=$div_id$ + style_class + >\n +    <div ><a $js_ad_click$ target=_blank>$js_ad_content$</a></div>\n +    <div ><img src=_//gif onClick=javascriptJsCloseDAD()></div>\n + </div>\nvar _lcon = MK_makeAdFodderHTML(DI_sImageUrl DI_sLeftImageUrl DI_iImageWidth DI_iImageHeight)var _rcon = MK_makeAdFodderHTML(DI_sImageUrl DI_sRightImageUrl DI_iImageWidth DI_iImageHeight)var _lstr = _tempreplace(/\$js_ad_click\$/gi DI_sClickUrl)replace(/\$div_id\$/gi DI_LDivreplace(/\$js_ad_content\$/gi _lcon)_lstr += left + _tempvar _rstr = _tempreplace(/\$js_ad_click\$/gi DI_sClickUrl)replace(/\$div_id\$/gi DI_RDivreplace(/\$js_ad_content\$/gi _rcon)_rstr += right + _tempdocumentwriteln(_lstr)documentwriteln(_rstr)setInterval(DI_Move() DI_iTimeout)}

  function DI_Move() { if(MK_pageW() < DI_iMinWindowWidth) { DI_Hide()return} DI_Show()try { var ldiv = documentgetElementById(DI_LDivMK_posY(ldiv DI_iTop)MK_posX(ldiv DI_iLeft)var rdiv = documentgetElementById(DI_RDivMK_posY(rdiv DI_iTop)MK_posX(rdiv MK_pageX() + MK_pageW() DI_iImageWidth DI_iRight)} catch(e) {} } /* start */ DI_Load()documentwrite(<img src= width= height= />

  第二個

  <SCRIPT src=js/showjs></SCRIPT>

  /*** *   左邊貼底浮動廣告代碼LBM (Left Bottom Move)

  *   Created by Moky @ //*/ LBM_sLeftImageUrl   = _//jpgLBM_sRightImageUrl   = _//jpgLBM_sClickUrl      = LBM_sImageUrl      = LBM_iImageWidth      = parseInt(if (isNaN(LBM_iImageWidth)) LBM_iImageWidth = LBM_iImageHeight   = parseInt(if (isNaN(LBM_iImageHeight)) LBM_iImageHeight =

  LBM_iLeft = LBM_iRight = LBM_iBottom = LBM_iMinTop =    /* avoid conflicts with double images */ LBM_iTimeout = /*—— common codes begin ——*/ var __bs__ = navigatoruserAgentindexOf(MSIE) >

  MSIE navigatoruserAgentindexOf(Safari) >

  Safari othersvar __dt__ = (documentdocumentElementclientHeight > ) &&(__bs__ == MSIE || documentbodyclientHeight > documentdocumentElementclientHeight) ?

  WC undefinedfunction MK_pageY() { if (__bs__ == MSIE) { if (__dt__ == WC

  return documentdocumentElementscrollTopelse return documentbodyscrollTop} else { return windowpageYOffset} function MK_pageX() { if (__bs__ == MSIE) { if (__dt__ == WC

  return documentdocumentElementscrollLeftelse return documentbodyscrollLeft} else { return windowpageXOffset} function MK_pageH() { if (__bs__ == Safari

  return windowinnerHeightelse if (__dt__ == WC

  return documentdocumentElementclientHeightelse return documentbodyclientHeight} function MK_pageW() { if (__bs__ == Safari

  return windowinnerWidthelse if (__dt__ == WC

  return documentdocumentElementclientWidthelse return documentbodyclientWidth} function MK_posY(o v) { if (!o || !ostyle) return if (v) { ostyletop = parseInt(v) + px} else { return ostyletop} function MK_posX(o v) { if (!o || !ostyle) return if (v) { ostyleleft = parseInt(v) + px} else { return ostyleleft}

  function MK_makeAdFodderHTML(sImageUrl sImageName iWidth iHeight) { var _src = sImageUrl == ? sImageName sImageUrlreturn (!_srcmatch(/\swf$/gi)? <img src=$src$ height= width= border= /> <object classid=clsidDCDBEAEDcfB + codebase=#version= + height= width=>\n + <param name=movie value=$src$ />\n + <param name=quality value=high />\n + <param name=wmode value=opaque />\n + <embed height= width= + src=$src$ quality=high wmode=opaque + type=application/xshockwaveflash pluginspace=> + </embed> + </object>replace(/\$src\$/gi _src)replace(/\$height\$/gi iHeight)replace(/\$width\$/gi iWidth)} function atoi(s) { var r = parseInt(s)return isNaN(r) ? r} function magic_locus(x x n) { x = atoi(xx = atoi(xn = atoi(n)var d = Mathabs(x xif (d < n) return magic_locus(x x d / return n <= ? x (x + (n) * x) / n } /*—— common codes end ——*/ function LBM_Load() { var style_class /*   try { if (__bs__ == MSIE

  documentstyleSheets[]addRule(div_floating_ad positionabsoluteelse documentstyleSheets[]insertRule(div_floating_ad {positionabsolute} documentstyleSheets[]cssRuleslength)style_class = class=div_floating_ad} catch(e) {*/ style_class = /*   }*/ var _ltemp = <div id=LBM_LDiv + style_class + > + <a $js_ad_click$ target=_blank>$js_ad_content$</a> + </div>var _lcon = MK_makeAdFodderHTML(LBM_sImageUrl LBM_sLeftImageUrl LBM_iImageWidth LBM_iImageHeight)var _lstr = _ltempreplace(/\$js_ad_click\$/gi LBM_sClickUrl)replace(/\$js_ad_content\$/gi _lcon)documentwriteln(_lstr)var _rtemp = <div id=LBM_RDiv + style_class + > + <a $js_ad_click$ target=_blank>$js_ad_content$</a> + </div>var _rcon = MK_makeAdFodderHTML(LBM_sImageUrl LBM_sRightImageUrl LBM_iImageWidth LBM_iImageHeight)var _rstr = _rtempreplace(/\$js_ad_click\$/gi LBM_sClickUrl)replace(/\$js_ad_content\$/gi _rcon)documentwriteln(_rstr)setInterval(LBM_Move() LBM_iTimeout)}

  function LBM_Move() { var _top = try { var _ldiv = documentgetElementById(LBM_LDiv

  var _left = MK_pageX() + LBM_iLeft_top = MK_pageY() + MK_pageH() LBM_iBottom LBM_iImageHeight/*—— magic locus begin add by moky @ // ——*/ _top = magic_locus(_top MK_posY(_ldiv) var max_y = MK_pageY() + MK_pageH()if (_top > max_y) _top = max_y/*—— magic locus end   add by moky @ // ——*/ if (_top < LBM_iMinTop) _top = LBM_iMinTop

  MK_posY(_ldiv _top)MK_posX(_ldiv _left)} catch(e) {}

  try { var _rdiv = documentgetElementById(LBM_RDiv

  var _right = MK_pageX() + MK_pageW() LBM_iImageWidth LBM_iRight

  var max_y = MK_pageY() + MK_pageH()if (_top > max_y) _top = max_y/*—— magic locus end   add by moky @ // ——*/ if (_top < LBM_iMinTop) _top = LBM_iMinTop

  MK_posY(_rdiv _top)MK_posX(_rdiv _right)} catch(e) {} } /* start */ LBM_Load()


From:http://tw.wingwit.com/Article/program/net/201311/12298.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.