home *** CD-ROM | disk | FTP | other *** search
/ PC User 2005 May / CD / PCU0505CD.iso / software / full / coffecup / files / html2005.exe / %MAINDIR% / DHTML / scrollableembeddedwindow.xml < prev    next >
Encoding:
Text File  |  2005-02-16  |  2.9 KB  |  93 lines

  1. <ccResource>
  2.   <ccTitle>
  3. DHTML Scrollable Embedded Window
  4.   </ccTitle>
  5.   <ccCategory>
  6. DHTML
  7.   </ccCategory>
  8.   <ccDescription>
  9.       This DHTML script will put a small, fixed,
  10.     scrollable window into your page. You can
  11.     change the height, width, background color
  12.     and content of the window.
  13.   </ccDescription>
  14.   <ccInstructions>
  15.     How to configure the script:
  16.  
  17.     The width of the "window" is 170 and the
  18.     height is 150. To alter the height and width
  19.     of the window, change ALL instances of 170 to
  20.     another value, and the same for 150 (it'll be
  21.     faster if you just do a search-and-replace).
  22.     You can also give the window a different
  23.     background color by changing "white" to another
  24.     color name or hex code. Also, change the text
  25.     to whatever you want by replacing the text (you
  26.     can use HTML as well) inside of the <DIV> tag.
  27.   </ccInstructions>
  28.   <ccHeadContent>
  29.   </ccHeadContent>
  30.   <ccBodyContent>
  31. <ilayer name="scroll1" width=170 height=150 clip="0,0,170,150">
  32.  
  33. <layer name="scroll2" width=170 height=150 bgColor="white">
  34.  
  35. <div id="scroll3" style="width:170;height:150;background-color:yellow;overflow:scroll">
  36.  
  37. This is a nifty little script that allows you to put any content you want within a scrollable mini "window". This will allow you to save valuable screen space while making your page more "interactive".
  38. <br><br>
  39. This script uses two different techniques, one for Internet Explorer and one for Netscape, to create the scrollable window. 
  40. <br><br>
  41. IE 4+ users will be able to use scrollbars to scroll the window, while Netscape users will have to use the "up" and "down" buttons instead (since Netscape does not support the adding of scrollbars to the "window" contents). 
  42.  
  43. </div>
  44. </layer>
  45. </ilayer>
  46.  
  47. <script>
  48.  
  49. var nsstyle='display:""'
  50. if (document.layers)
  51. var scrolldoc=document.scroll1.document.scroll2
  52. function up(){
  53. if (!document.layers) return
  54. if (scrolldoc.top<0)
  55. scrolldoc.top+=10
  56. temp2=setTimeout("up()",50)
  57. }
  58. function down(){
  59. if (!document.layers) return
  60. if (scrolldoc.top-150>=scrolldoc.document.height*-1)
  61. scrolldoc.top-=10
  62. temp=setTimeout("down()",50)
  63. }
  64.  
  65. function clearup(){
  66. if (window.temp2)
  67. clearInterval(temp2)
  68. }
  69.  
  70. function cleardown(){
  71. if (window.temp)
  72. clearInterval(temp)
  73. }
  74.  
  75. </script>
  76.  
  77. <br><span style="display:none" style=&{nsstyle};><a href="#" onMousedown="up()"
  78. onMouseup="clearup()" onClick="return false" onMouseout="clearup()">Up</a> | <a href="#"
  79. onMousedown="down()" onMouseup="cleardown()" onClick="return false"
  80. onMouseout="cleardown()">Down</a> | <a href="#" onClick="if (document.layers) scrolldoc.top=0;return false">Top</a> | <a href="#" onClick="if (document.layers) scrolldoc.top=scrolldoc.document.height*(-1)+150;return false">Bottom</a></span>
  81.  
  82.  
  83.   </ccBodyContent>
  84.   <ccElementContent>
  85.   
  86.    <ccElementName></ccElementName>
  87.    <ccElementAction></ccElementAction>
  88.    
  89.   </ccElementContent>
  90.   <ccExtraData>
  91.  
  92.   </ccExtraData>
  93. </ccResource>