Bosna i Hercegovina


switch Lista naslova:

zxz Offline
Administrator
Registrovan/a od: 03.02.2009-16:22
Komentari: 9,214


Subject: Koristan JavaScript kod*
Kako koristiti kod.
Dovoljno je podici notepad i u njega nakoširati ovo:
<HTML>
<HEAD>
<TITLE>Neki naslov za title</TITLE>
</HEAD>
<BODY>
<!--<ispod ovoga kopirajte java kod-->

<!--Poslije java koda ovo ispod-->
</BODY>
</HTML>

Stranicu zaspisati kao html:
Primjer:
Mojprimjer.html
Pozdrav
Ovaj komentar je mijenjan 3 puta. zadnja izmjena 03.03.2013-15:48 od strane zxz. ↑  ↓

zxz Offline
Administrator
Registrovan/a od: 03.02.2009-16:22
Komentari: 9,214


Subject: Kod za trazenje na stranici.
Kod za trazenje na stranici.


DownloadIzvorni kod (Javascript):
  1. <script language="JavaScript">
  2. /*
  3. Nadji na stranici-
  4. Posjetite [URL="http://www.icentar.com/"]http://www.icentar.com[/URL]
  5. */
  6. var NS4 = (document.layers);    // Which browser?
  7. var IE4 = (document.all);
  8. var win = window;    // window to search.
  9. var n   = 0;
  10. function findInPage(str) {
  11.   var txt, i, found;
  12.   if (str == "")
  13.     return false;
  14.   // Find next occurance of the given string on the page, wrap around to the
  15.   // start of the page if necessary.
  16.   if (NS4) {
  17.     // Look for match starting at the current point. If not found, rewind
  18.     // back to the first match.
  19.     if (!win.find(str))
  20.       while(win.find(str, false, true))
  21.         n++;
  22.     else
  23.       n++;
  24.     // If not found in either direction, give message.
  25.     if (n == 0)
  26.       alert("Takve rijeci nema.");
  27.   }
  28.   if (IE4) {
  29.     txt = win.document.body.createTextRange();
  30.  
  31.     // Find the nth match from the top of the page.
  32.     for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) {
  33.       txt.moveStart("character", 1);
  34.       txt.moveEnd("textedit");
  35.     }
  36.     // If found, mark it and scroll it into view.
  37.     if (found) {
  38.       txt.moveStart("character", -1);
  39.       txt.findText(str);
  40.       txt.select();
  41.       txt.scrollIntoView();
  42.       n++;
  43.     }
  44.     // Otherwise, start over at the top of the page and find first match.
  45.     else {
  46.       if (n > 0) {
  47.         n = 0;
  48.         findInPage(str);
  49.       }
  50.       // Not found anywhere, give message.
  51.       else
  52.         alert("Takve rijeci nema.");
  53.     }
  54.   }
  55.   return false;
  56. }
  57. </script>
  58. <form name="search" onSubmit="return findInPage(this.string.value);">
  59. <font size=3><input name="string" type="text" size=15 onChange="n = 0;"></font>
  60. <input type="submit" value="Find">
  61. </form>

Pozdrav
↑  ↓

zxz Offline
Administrator
Registrovan/a od: 03.02.2009-16:22
Komentari: 9,214


Subject: Zabrana desnog klika misa.
Zabrana desnog klika misa.


DownloadIzvorni kod (Javascript):
  1. <script language=JavaScript>
  2. <!--
  3. var message="Zabranjeno kopiranje!";
  4. ///////////////////////////////////
  5. function clickIE() {if (document.all) {alert(message);return false;}}
  6. function clickNS(e) {if
  7. (document.layers||(document.getElementById&&!document.all)) {
  8. if (e.which==2||e.which==3) {alert(message);return false;}}}
  9. if (document.layers)
  10. {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
  11. else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
  12. // -->
  13. </script>

Pozdrav
↑  ↓

zxz Offline
Administrator
Registrovan/a od: 03.02.2009-16:22
Komentari: 9,214


Subject: Otvara vasu stranicu u ful skrin.
Otvara vasu stranicu u ful skrin.


DownloadIzvorni kod (Javascript):
  1. <SCRIPT TYPE="text/javascript" LANGUAGE="javascript">
  2. <!-- [URL="http://www.jahu.net/"]www.jahu.net[/URL] -->
  3. // ?irina i visina
  4. var windowW=screen.width  // ?irina
  5. var windowH=screen.height // visina
  6. // Pozicija pokazivanja, za fullscreen 0 i 0
  7. var windowX = 0
  8. var windowY = 0
  9. // Stranica koja ce se loadirati
  10.  
  11. var urlPop = "[URL="http://www.icentar.com/"]http://www.icentar.com[/URL]"
  12. // Naziv stranice
  13. // Promijeni webmajstor u svoj title
  14. var title =  "webmajstor"
  15. // =======================================
  16. // NE MIJENJAJTE NI?TA ISPOD!
  17. // =======================================
  18. var autoclose = true
  19. s = "width="+windowW+",height="+windowH;
  20. var beIE = document.all?true:false
  21. function openFrameless(){
  22.   if (beIE){
  23.     NFW = window.open("","popFrameless","fullscreen,"+s)    
  24.     NFW.blur()
  25.     window.focus()      
  26.     NFW.resizeTo(windowW,windowH)
  27.     NFW.moveTo(windowX,windowY)
  28.     var frameString=""+
  29. "<html>"+
  30. "<head>"+
  31. "<title>"+title+"</title>"+
  32. "</head>"+
  33. "<frameset rows='*,0' framespacing=0 border=0 frameborder=0>"+
  34. "<frame name='top' src='"+urlPop+"' scrolling=auto>"+
  35. "<frame name='bottom' src='about:blank' scrolling='no'>"+
  36. "</frameset>"+
  37. "</html>"
  38.     NFW.document.open();
  39.     NFW.document.write(frameString)
  40.     NFW.document.close()
  41.   } else {
  42.     NFW=window.open(urlPop,"popFrameless","scrollbars,"+s)
  43.     NFW.blur()
  44.     window.focus()
  45.     NFW.resizeTo(windowW,windowH)
  46.     NFW.moveTo(windowX,windowY)
  47.   }  
  48.   NFW.focus()  
  49.   if (autoclose){
  50.     window.onunload = function(){NFW.close()}
  51.   }
  52. }
  53. //-->
  54. </SCRIPT

Pozdrav
↑  ↓

zxz Offline
Administrator
Registrovan/a od: 03.02.2009-16:22
Komentari: 9,214


Subject: Print taster.
Print taster.


DownloadIzvorni kod (Javascript):
  1. <SCRIPT Language="Javascript">
  2.  
  3. function printit(){  
  4. if (window.print) {
  5.     window.print() ;  
  6. } else {
  7.     var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
  8. document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
  9.     WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";  
  10. }
  11. }
  12. </script>
  13. <SCRIPT Language="Javascript">  
  14. var NS = (navigator.appName == "Netscape");
  15. var VERSION = parseInt(navigator.appVersion);
  16. if (VERSION > 3) {
  17.     document.write('<form><input type=button value="Print" name="Print" onClick="printit()"></form>');        
  18. }
  19. </script>

Pozdrav
Ovaj komentar je mijenjan 1 puta. zadnja izmjena 21.09.2010-22:07 od strane zxz. ↑  ↓

zxz Offline
Administrator
Registrovan/a od: 03.02.2009-16:22
Komentari: 9,214


Subject: Grad edit bar
Grad edit bar



DownloadIzvorni kod (Javascript):
  1. <script language="JavaScript1.2">
  2. <!--
  3. /*
  4. Gradient Bar Script (By Alex Szorkovszky [EMAIL="alex@wmresources.com"]alex@wmresources.com[/EMAIL])
  5. */
  6. if (document.all){
  7. one=new Array();
  8. two=new Array();
  9. var a=10;var b=11;var c=12;var d=13;var e=14;var f=15;
  10.  
  11. //Promijenite gradijent
  12. //Duzinu i visinu gradienta
  13. var width = 350;
  14. var height = 20;
  15. //broj pixela izmedju boja
  16. var gap = 5;
  17. //0 za horizontal, 1 za vertical
  18. var direction = 0;
  19. //broj boje 1 - upisi 1-vo, 3-ce i 5-ti broj/slovo colour coda
  20. one[0]=f;
  21. one[1]=9;
  22. one[2]=0;
  23. //broj boje 2 - upisi 1-vo, 3-ce i 5-ti broj/slovo colour coda
  24. two[0]=c;
  25. two[1]=c;
  26. two[2]=c;
  27.  
  28. //kraj konfiguracije
  29.  
  30. if(direction==0) var num = width / gap;
  31. if(direction==1) var num = height / gap;
  32. color2=new Array();
  33. color1=new Array();
  34. diff=new Array();
  35. for(i=0;i<3;i++) {
  36. diff[i] = two[i] - one[i];
  37. diff[i] = diff[i] / num;
  38. }
  39. for(i=0;i<3;i++){
  40. color1[i] = Math.round(diff[i] * Math.pow(10, 0));
  41. if(color1[i] > diff[i])color1[i] = color1[i] - 1;
  42. color2[i] = diff[i] - color1[i];
  43. color2[i] = color2[i] * 15;
  44. color2[i] = Math.round(color2[i] * Math.pow(10, 0));
  45. }
  46. x=new Array();
  47. two[0]=0;
  48. two[1]=0;
  49. two[2]=0;
  50. document.write('<table border="0" cellpadding="0" cellspacing="0" width="'+width+'" height="'+height+'">');
  51. if(direction==0) document.write('<tr>');
  52. for(i=0;i<=num;i++) {
  53. if(direction==1) document.write('<tr>');
  54. document.write('<td bgcolor="#');
  55. for(j=0;j<3;j++) {
  56. if(one[j]==a)document.write("a");
  57. if(one[j]==b)document.write("b");
  58. if(one[j]==c)document.write("c");
  59. if(one[j]==d)document.write("d");
  60. if(one[j]==e)document.write("e");
  61. if(one[j]==f)document.write("f");
  62. if(one[j]<10)document.write(one[j]);
  63. if(two[j]==a)document.write("a");
  64. if(two[j]==b)document.write("b");
  65. if(two[j]==c)document.write("c");
  66. if(two[j]==d)document.write("d");
  67. if(two[j]==e)document.write("e");
  68. if(two[j]==f)document.write("f");
  69. if(two[j]<10)document.write(two[j]);
  70. one[j] = one[j] + color1[j];
  71. two[j] = two[j] + color2[j];
  72. if(two[j]>15) {
  73. two[j] = two[j] - 15;
  74. one[j]++;
  75. }
  76. }
  77. if(direction==0) document.write('" width="'+gap+'" height="'+height+'"> </td>');
  78. if(direction==1) document.write('" width="'+width+'" height="'+gap+'"> </td></tr>');
  79. }
  80. document.write('</table>');
  81. }
  82. //-->
  83. </script>

Pozdrav
↑  ↓

zxz Offline
Administrator
Registrovan/a od: 03.02.2009-16:22
Komentari: 9,214


Subject: Printanje stranice
Ako vam treba printanje vase stranice odnosno da napravite taster print onda koristite ovaj kod.

DownloadIzvorni kod (Javascript):
  1. <script Language="Javascript">
  2.  
  3. function printit(){  
  4. if (window.print) {
  5.     window.print() ;  
  6. } else {
  7.     var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
  8. document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
  9.     WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";  
  10. }
  11. }
  12. <script Language="Javascript">  
  13. var NS = (navigator.appName == "Netscape");
  14. var VERSION = parseInt(navigator.appVersion);
  15. if (VERSION > 3) {
  16.     document.write('<form><input type=button value="Print" name="Print" onClick="printit()"></form>');        
  17. }

Pozdrav
Ovaj komentar je mijenjan 1 puta. zadnja izmjena 04.03.2012-00:29 od strane zxz. ↑  ↓

zxz Offline
Administrator
Registrovan/a od: 03.02.2009-16:22
Komentari: 9,214


Subject: Dijalog box OK Cancel
Kod dolazi unotar Body u html.
DownloadIzvorni kod (Javascript):
  1. <script type="text/javascript">
  2. var ime = confirm("Pritisnite gumb")
  3. if (ime == true)
  4. {
  5. document.write("Pritisnuli ste OK")
  6. }
  7. else
  8. {
  9. document.write("Pritisnuli ste Cancel")
  10. }
  11. </script>

Pozdrav
↑  ↓

zxz Offline
Administrator
Registrovan/a od: 03.02.2009-16:22
Komentari: 9,214


Subject: Input Box
Kod postaviti izmedju Body u HTML
DownloadIzvorni kod (Javascript):
  1. <script type="text/javascript">
  2. var ime = prompt("Unesite svoje ime","")
  3. if (ime != null && ime != "")
  4. {
  5. document.write("Dobrodošli " + ime)
  6. }
  7. </script>

Pozdrav
↑  ↓

zxz Offline
Administrator
Registrovan/a od: 03.02.2009-16:22
Komentari: 9,214


Subject: Otvaranje novog prozora
Prekopirajte kod u TxT file i dajte mu extenziju html.
DownloadIzvorni kod (Text):
  1. <HTML>
  2. <HEAD>
  3. <META NAME="generator" CONTENT="toniarts easyhtml v.2.4">
  4. <TITLE>Title of your page</TITLE>
  5. </HEAD>
  6. <BODY>
  7. <script type="text/javascript">
  8. function prozor()
  9. {
  10. window.open("http://www.google.com","moje_novo_okno","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=300, height=300")
  11. }
  12. </script>
  13.  
  14. <form>
  15. <input type="button" value="Otvori prozor" onclick="prozor()">
  16. <a href="javascript:prozor()">Otvori ba</a>
  17. </form>
  18. <br />
  19. </BODY>
  20. </HTML>

DownloadIzvorni kod (HTML):
  1. <!DOCTYPE html>
  2. function OtvoriProzor()
  3. {
  4. var MojProzor = window.open("","","width=200,height=100");
  5. MojProzor.document.write("<p>ovo je 'MojProzor'</p>");
  6. MojProzor.focus();
  7. MojProzor.document.write("<p>E ovo je novi prozor</p>");
  8. }
  9. </head>
  10.  
  11. <button onclick="OtvoriProzor()">OtvoriProzor</button>
  12.  
  13. </body>
  14. </html>

Pozdrav
Ovaj komentar je mijenjan 1 puta. zadnja izmjena 02.01.2014-09:44 od strane zxz. ↑  ↓

zxz Offline
Administrator
Registrovan/a od: 03.02.2009-16:22
Komentari: 9,214


Subject: Valoviti tekst
DownloadIzvorni kod (Text):
  1. <HTML>
  2. <HEAD>
  3. <META NAME="generator" CONTENT="toniarts easyhtml v.2.4">
  4. <TITLE>Title of your page</TITLE>
  5. </HEAD>
  6. <BODY>
  7. <script language="JavaScript1.2">
  8.  
  9. message="Dobro došli na portal iCentar"
  10.  
  11. ns6switch=1
  12.  
  13.  
  14. var ns6=document.getElementById&&!document.all
  15.  
  16. mes=new Array();
  17.  
  18. mes[0]=-1;
  19.  
  20. mes[1]=-4;
  21.  
  22. mes[2]=-7;mes[3]=-10;
  23.  
  24. mes[4]=-7;
  25.  
  26. mes[5]=-4;
  27.  
  28. mes[6]=-1;
  29.  
  30. num=0;
  31.  
  32. num2=0;
  33.  
  34. txt="";
  35.  
  36. function jump0(){
  37.  
  38. if (ns6&&!ns6switch){
  39.  
  40. jump.innerHTML=message
  41.  
  42. return
  43.  
  44. }
  45.  
  46. if(message.length > 6){
  47.  
  48. for(i=0; i != message.length;i++){
  49.  
  50. txt=txt+"<span style='position:relative;' id='n"+i+"'>"+message.charAt(i)+"</span>"};
  51.  
  52. jump.innerHTML=txt;
  53.  
  54. txt="";
  55.  
  56. jump1a()
  57.  
  58. }
  59.  
  60. else{
  61.  
  62. alert("Prekratko")
  63.  
  64. }
  65.  
  66. }
  67.  
  68.  
  69.  
  70. function jump1a(){
  71.  
  72. nfinal=(document.getElementById)? document.getElementById("n0") : document.all.n0
  73.  
  74. nfinal.style.left=-num2;
  75.  
  76. if(num2 != 9){
  77.  
  78. num2=num2+3;
  79.  
  80. setTimeout("jump1a()",50)
  81.  
  82. }
  83.  
  84. else{
  85.  
  86. jump1b()
  87.  
  88. }
  89.  
  90. }
  91.  
  92.  
  93.  
  94. function jump1b(){
  95.  
  96. nfinal.style.left=-num2;
  97.  
  98. if(num2 != 0){num2=num2-3;
  99.  
  100. setTimeout("jump1b()",50)
  101.  
  102. }
  103.  
  104. else{
  105.  
  106. jump2()
  107.  
  108. }
  109.  
  110. }
  111.  
  112.  
  113.  
  114. function jump2(){
  115.  
  116. txt="";
  117.  
  118. for(i=0;i != message.length;i++){
  119.  
  120. if(i+num > -1 && i+num < 7){
  121.  
  122. txt=txt+"<span style='position:relative;top:"+mes[i+num]+"'>"+message.charAt(i)+"</span>"
  123.  
  124. }
  125.  
  126. else{txt=txt+"<span>"+message.charAt(i)+"</span>"}
  127.  
  128. }
  129.  
  130. jump.innerHTML=txt;
  131.  
  132. txt="";
  133.  
  134. if(num != (-message.length)){
  135.  
  136. num--;
  137.  
  138. setTimeout("jump2()",50)}
  139.  
  140. else{num=0;
  141.  
  142. setTimeout("jump0()",50)}}
  143.  
  144. </script>
  145.  
  146. </head>
  147.  
  148. <body>
  149.  
  150.  
  151.  
  152. <h2><div id="jumpx" style="color:black"></div></h2>
  153.  
  154. <script>
  155.  
  156. if (document.all||document.getElementById){
  157.  
  158. jump=(document.getElementById)? document.getElementById("jumpx") : document.all.jumpx
  159.  
  160. jump0()
  161.  
  162. }
  163.  
  164. else
  165.  
  166. document.write(message)
  167.  
  168. </script>
  169. </BODY>
  170. </HTML>

Pozdrav
↑  ↓

zxz Offline
Administrator
Registrovan/a od: 03.02.2009-16:22
Komentari: 9,214


Subject: Pulsirajuci link
DownloadIzvorni kod (Text):
  1. <HTML>
  2. <HEAD>
  3. <META NAME="generator" CONTENT="toniarts easyhtml v.2.4">
  4. <TITLE>Title of your page</TITLE>
  5. </HEAD>
  6. <BODY>
  7. <span id="theText" style="width:100%">
  8. <h3 align="center"><font color="#000000"><font size="+5"><A HREF="http://www.icentar.ba/index.php">iCentar</A></font>
  9. </font>
  10. <script>
  11. var from = 5;
  12. var to = 11;
  13. var delay = 55;
  14. var glowColor = "red";
  15. var glowColor2 = "orange";
  16. var glowColor3 = "yellow";
  17. var glowColor4 = "lime";
  18. var glowColor5 = "blue";
  19. var glowColor6 = "magenta";
  20.  
  21. var i = to;
  22. var j = 0;
  23. textPulseDown();
  24. function textPulseUp()
  25. {
  26. if (!document.all)
  27. return
  28. if (i < to)
  29. {
  30. theText.style.filter = "Glow(Color=" + glowColor + ", Strength=" + i + ")";
  31. i++;
  32. theTimeout = setTimeout('textPulseUp()',delay);
  33. return 0;
  34. }
  35. if (i = to)
  36. {
  37. theTimeout = setTimeout('textPulseDown()',delay);
  38. return 0;
  39. }
  40. }
  41. function textPulseDown()
  42. {
  43. if (!document.all)
  44. return
  45. if (i > from)
  46. {
  47. theText.style.filter = "Glow(Color=" + glowColor2 + ", Strength=" + i + ")";
  48. i--;
  49. theTimeout = setTimeout('textPulseDown()',delay);
  50. return 0;
  51. }
  52. if (i = from)
  53. {
  54. theTimeout = setTimeout('textPulseUp2()',delay);
  55. return 0;
  56. }
  57. }
  58.  
  59. function textPulseUp2()
  60. {
  61. if (!document.all)
  62. return
  63. if (i < to)
  64. {
  65. theText.style.filter = "Glow(Color=" + glowColor3 + ", Strength=" + i + ")";
  66. i++;
  67. theTimeout = setTimeout('textPulseUp2()',delay);
  68. return 0;
  69. }
  70. if (i = to)
  71. {
  72. theTimeout = setTimeout('textPulseDown2()',delay);
  73. return 0;
  74. }
  75. }
  76. function textPulseDown2()
  77. {
  78. if (!document.all)
  79. return
  80. if (i > from)
  81. {
  82. theText.style.filter = "Glow(Color=" + glowColor4 + ", Strength=" + i + ")";
  83. i--;
  84. theTimeout = setTimeout('textPulseDown2()',delay);
  85. return 0;
  86. }
  87. if (i = from)
  88. {
  89. theTimeout = setTimeout('textPulseUp3()',delay);
  90. return 0;
  91. }
  92. }
  93. function textPulseUp3()
  94. {
  95. if (!document.all)
  96. return
  97. if (i < to)
  98. {
  99. theText.style.filter = "Glow(Color=" + glowColor5 + ", Strength=" + i + ")";
  100. i++;
  101. theTimeout = setTimeout('textPulseUp3()',delay);
  102. return 0;
  103. }
  104. if (i = to)
  105. {
  106. theTimeout = setTimeout('textPulseDown3()',delay);
  107. return 0;
  108. }
  109. }
  110. function textPulseDown3()
  111. {
  112. if (!document.all)
  113. return
  114. if (i > from)
  115. {
  116. theText.style.filter = "Glow(Color=" + glowColor6 + ", Strength=" + i + ")";
  117. i--;
  118. theTimeout = setTimeout('textPulseDown3()',delay);
  119. return 0;
  120. }
  121. if (i = from)
  122. {
  123. theTimeout = setTimeout('textPulseUp()',delay);
  124. return 0;
  125. }
  126. }
  127. </script></font></h3></span>
  128. </BODY>
  129. </HTML>

Pozdrav
Ovaj komentar je mijenjan 1 puta. zadnja izmjena 18.02.2011-11:45 od strane zxz. ↑  ↓

zxz Offline
Administrator
Registrovan/a od: 03.02.2009-16:22
Komentari: 9,214


Subject: Zoom tekst
DownloadIzvorni kod (Text):
  1. <HTML>
  2. <HEAD>
  3. <META NAME="generator" CONTENT="toniarts easyhtml v.2.4">
  4. <TITLE>Title of your page</TITLE>
  5. <style type="text/css">
  6. #divZoom {position:absolute; left:0px; top:170px; width:100%; text-align:center;}
  7. </style>
  8. <script language="JavaScript" type="text/javascript">
  9.  
  10. function lib_bwcheck(){ //Browsercheck (needed)
  11.         this.ver=navigator.appVersion
  12.         this.agent=navigator.userAgent
  13.         this.dom=document.getElementById?1:0
  14.         this.opera5=this.agent.indexOf("Opera 5")>-1
  15.         this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
  16.         this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
  17.         this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
  18.         this.ie=this.ie4||this.ie5||this.ie6
  19.         this.mac=this.agent.indexOf("Mac")>-1
  20.         this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
  21.         this.ns4=(document.layers && !this.dom)?1:0;
  22.         this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
  23.         return this
  24. }
  25. var bw=new lib_bwcheck()
  26.  
  27.  
  28. /*Here are the variables you have to set, play with different values:
  29. First the text: (it will stop and fade/change the colors on the last one)*/
  30. zText=new Array('Dobro došli','Na','iCenatar','Forum')
  31.  
  32. //Now the colors:
  33. //all you have to do is set the color you want to have in here:
  34. //(the first color will be the color that the text is when it zooms.)
  35. zColor=new Array('#202020','#424242','#8E8E8E','#C2C2C2','#E8E8E8')
  36.  
  37. var zEndSize=70   //The fontsize in px you want the zoom to end at
  38. var zSpeed=70     //Zoom speed
  39. var zAddSize=5    //Px to add to the fontsize on each interval
  40. var zFadeSpeed=70 //Color change/fade speed
  41. var zFont='arial black,arial,helvetica,sans-serif' //Font
  42. var zHide=true    //do you want it to hide when its done? (true or false)
  43. var zHideWait=1000  //Time to wait before hiding
  44. var zStartSize=10 //The size to start at
  45. var zEndCode=""   // Code to execute when the zoom and fade is finished. ie: "location.href='newpage.html', executes when the hide does.
  46.  
  47. /*You can remove this if you don't wan't it to start right away.
  48. You can have it start if someone clicks a link (make a link like this:
  49. <a href="#" onclick="fadeInit()">Click to Zoomtext</a>)*/
  50. //onload=zoomInit;
  51.  
  52. /********* You shouldn't really have to set anything below this point ***********/
  53.  
  54. //Object functions
  55. function makeZoomObj(obj,font,size,endsize,color,text,zspeed,fadespeed,addsize,hide,hidewait,endcode){
  56.         this.css=bw.dom? document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?document.layers[obj]:0;
  57.         this.writeref=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?document.layers[obj].document:0;
  58.         this.zoomWrite=b_zoomWrite;     this.zoomIt=b_zoomIt; this.fadeIt=b_fadeIt;     this.zoomFade=b_zoomFade;
  59.         this.font=font; this.color=new Array(); this.color=eval(color); this.text=new Array(); this.text=eval(text);
  60.         this.zspeed=zspeed; this.fadespeed=fadespeed; this.addsize=addsize; this.endcode=endcode
  61.         this.hide=hide; this.hidewait=hidewait; this.size=size; this.startsize=size; this.endsize=endsize
  62.         if(size<endsize){this.way="<"; this.addsize=this.addsize
  63.     }else{this.way=">"; this.addsize=-this.addsize}
  64.         if(bw.dom || bw.ie4){ //Setting the style properties
  65.                 this.css.fontFamily=this.font; this.css.fontSize=this.size+"px"; this.css.color=this.color[0]
  66.         }
  67.         this.obj = obj + "Object";      eval(this.obj + "=this"); return this
  68. }
  69. function b_zoomFade(num){
  70.         if(num<this.text.length){
  71.                 this.size=this.startsize
  72.                 this.zoomIt(num,'this.zoomFade('+(num+1)+')')
  73.         }
  74.         else if(num==this.text.length) this.fadeIt(0,'this.zoomFade('+(num+1)+')')
  75.         else if(this.hide) setTimeout(this.obj+".css.visibility='hidden'; eval("+this.obj+".endcode)",this.hidewait)
  76. }
  77. function b_zoomWrite(num,cnum){
  78.         if(bw.ns4){
  79.                 this.writeref.write('<span style="text-align:center; font-size:' +this.size+'px; font-family:'+this.font+'; color:'+this.color[cnum]+'">'+this.text[num]+'</span>')
  80.                 this.writeref.close()
  81.         }else this.writeref.innerHTML="<center>"+this.text[num]+"</center>"
  82. }
  83. function b_zoomIt(num,fn){
  84.         if(eval(this.size+this.way+this.endsize)){
  85.                 if(this.size==this.startsize || bw.ns4) this.zoomWrite(num,0)
  86.                 if(bw.dom || bw.ie4) this.css.fontSize=this.size+"px"
  87.                 this.size=this.size+this.addsize
  88.                 setTimeout(this.obj+".zoomIt("+num+",'"+fn+"')",this.zspeed)
  89.         }else eval(fn)
  90. }
  91. function b_fadeIt(num,fn){
  92.         if(num<this.color.length){
  93.                 if(bw.ns4) this.zoomWrite(this.text.length-1,num)
  94.                 else this.css.color=this.color[num]
  95.                 num++
  96.                 setTimeout(this.obj+".fadeIt("+num+",'"+fn+"')",this.fadespeed)
  97.         }else eval(fn)
  98. }
  99. /*Initiates the object, shows it and starts the zoom
  100. ****************************************************************************/
  101. function zoomInit(){
  102.         if(bw.bw){
  103.                 oZoom=new makeZoomObj('divZoom',zFont,zStartSize,zEndSize,'zColor','zText',zSpeed,zFadeSpeed,zAddSize,zHide,zHideWait,zEndCode)
  104.                 oZoom.zoomFade(0)
  105.                 oZoom.css.visibility='visible'
  106.         }
  107. }
  108. </script>
  109.  
  110. </HEAD>
  111. <BODY>
  112. <div id="divZoom" align="center"></div>
  113.  
  114. <a href="#" onclick="zoomInit(); return false">Start</a>
  115.  
  116. </BODY>
  117. </HTML>

Pozdrav
↑  ↓

zxz Offline
Administrator
Registrovan/a od: 03.02.2009-16:22
Komentari: 9,214


Subject: Šetajući tekst
DownloadIzvorni kod (Text):
  1. <HTML>
  2. <HEAD>
  3. <META NAME="generator" CONTENT="toniarts easyhtml v.2.4">
  4. <TITLE>Title of your page</TITLE>
  5. <script language="javascript">
  6.  
  7. for (i=0; i<29 ;i++) {
  8.  
  9. document.write("<style type='text/css'>#m"+i+"{ position: absolute; left: 0px; top: 0px;}<\/style>\n")
  10.  
  11. }
  12.  
  13. </script>
  14. </HEAD>
  15. <BODY>
  16. <script language="javascript">
  17.  
  18. var ax=20, ay=20
  19.  
  20. var speedx1=3, speedy1=3
  21.  
  22. var speedx2=3, speedy2=3
  23.  
  24. text="iCentar.ba portal"    ; // Maksimalno 30 znakova
  25.  
  26. anzahl=text.length
  27.  
  28. x=new Array()
  29.  
  30. y=new Array()
  31.  
  32. xst=new Array()
  33.  
  34. yst=new Array()
  35.  
  36.  
  37.  
  38. var ns4up = (document.layers) ? 1 : 0;
  39.  
  40. var ie4up = (document.all) ? 1 : 0;
  41.  
  42. if (ns4up) {
  43.  
  44.  hoehe = self.innerHeight-35;
  45.  
  46.  breite= self.innerWidth-anzahl*11;
  47.  
  48. } else if (ie4up) {
  49.  
  50.  hoehe = document.body.clientHeight-35;
  51.  
  52.  breite = document.body.clientWidth-anzahl*11;
  53.  
  54. }
  55.  
  56. var mx=breite, my=hoehe
  57.  
  58. document.write("<font color=\"#0000FF\">\n")         ; // Boja teksta
  59.  
  60. document.write("<b><tt><font size=\"+1\">\n")        ; //Veli
  61. ina i bold
  62.  
  63. for (i=0; i<anzahl ;i++) {
  64.  
  65. document.write("<div id='m"+i+"'>"+text.substr(i,1)+"<\/div>\n")
  66.  
  67. x[i]=0
  68.  
  69. y[i]=0
  70.  
  71. }
  72.  
  73. document.write("<\/font><\/tt></b><\/font>\n")
  74.  
  75. zufall()
  76.  
  77. mt()
  78.  
  79. function mt() {
  80.  
  81. xst[0]=(mx-x[0]+ax)/speedx1
  82.  
  83. yst[0]=(my-y[0]+ay)/speedy1
  84.  
  85. x[0]=x[0]+xst[0]
  86.  
  87. y[0]=y[0]+yst[0]
  88.  
  89. for (i=1; i<anzahl; i++) {
  90.  
  91. xst[i]=(x[i-1]-x[i]+10)/speedx2
  92.  
  93. yst[i]=(y[i-1]-y[i])/speedy2
  94.  
  95. x[i]=x[i]+xst[i]
  96.  
  97. y[i]=y[i]+yst[i]
  98.  
  99. }
  100.  
  101. if (Math.abs(xst[0])<0.2 && Math.abs(yst[0])<0.2 && Math.abs(xst[anzahl-1])<0.2 && Math.abs(yst[anzahl-1])<0.2) {zufall()}
  102.  
  103. for (i=0; i<anzahl; i++) {
  104.  
  105. if (ns4up) {
  106.  
  107. document.layers["m"+i].left=x[i]
  108.  
  109. document.layers["m"+i].top=y[i]
  110.  
  111. }
  112.  
  113. if (ie4up) {
  114.  
  115. document.all["m"+i].style.pixelLeft=x[i]
  116.  
  117. document.all["m"+i].style.pixelTop=y[i]
  118.  
  119. }}
  120.  
  121. setTimeout("mt()",10)
  122.  
  123. }
  124.  
  125. function zufall() {
  126.  
  127. if (ns4up) {
  128.  
  129. mx=breite*Math.random()+pageXOffset
  130.  
  131. my=hoehe*Math.random()+pageYOffset
  132.  
  133. }
  134.  
  135. if (ie4up) {
  136.  
  137. mx=breite*Math.random()+document.body.scrollLeft
  138.  
  139. my=hoehe*Math.random()+document.body.scrollTop
  140.  
  141. }
  142.  
  143. speedx1=Math.random()*10+1
  144.  
  145. speedy1=Math.random()*10+1
  146.  
  147. speedx2=Math.random()*10+1
  148.  
  149. speedy2=Math.random()*10+1
  150.  
  151. }
  152.  
  153. </script>
  154. </BODY>
  155. </HTML>

Pozdrav
↑  ↓

zxz Offline
Administrator
Registrovan/a od: 03.02.2009-16:22
Komentari: 9,214


Subject: Predhodna posjeta
DownloadIzvorni kod (Text):
  1. <HTML>
  2. <HEAD>
  3. <META NAME="generator" CONTENT="toniarts easyhtml v.2.4">
  4. <TITLE>Title of your page</TITLE>
  5. <SCRIPT LANGUAGE = "JavaScript">
  6. <!-- Begin Script
  7. var expDays = 30;
  8. var exp = new Date();
  9. exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
  10.  
  11. function When(info){
  12.         // When
  13.                 var rightNow = new Date()
  14.                 var WWHTime = 0;
  15.                 WWHTime = GetCookie('WWhenH')
  16.  
  17.                 WWHTime = WWHTime * 1
  18.  
  19.                 var lastHereFormatting = new Date(WWHTime);  // Date-i-fy that number
  20.                 var intLastVisit = (lastHereFormatting.getYear() * 10000)+(lastHereFormatting.getMonth() * 100) + lastHereFormatting.getDate()
  21.                 var lastHereInDateFormat = "" + lastHereFormatting;  // Gotta use substring functions
  22.                 var dayOfWeek = lastHereInDateFormat.substring(0,3)
  23.                 var dateMonth = lastHereInDateFormat.substring(4,10)
  24.                 var hours = "" + lastHereFormatting.getHours()
  25.                 var year = lastHereFormatting.getYear()
  26.                 if (year < 1000) year+=1900
  27.                 var minutes = "" + lastHereFormatting.getMinutes()
  28.                 if (minutes.substring(0,1) == minutes){
  29.                         minutes = "0" + minutes
  30.                 }
  31.                 var WWHText = dayOfWeek + ", " + dateMonth + " " + year + " at " +  hours + ":" + minutes// display
  32.  
  33.                 SetCookie ("WWhenH", rightNow.getTime(), exp)
  34.  
  35.         return WWHText;
  36. }
  37.  
  38. function Count(info){
  39.         var psj=0;
  40.         // How many times
  41.                 var WWHCount = GetCookie('WWHCount')
  42.                 if (WWHCount == null) {
  43.                         WWHCount = 0;
  44.                 }
  45.                 else{
  46.                         WWHCount++;
  47.                 }
  48.                 SetCookie ('WWHCount', WWHCount, exp);
  49.  
  50.  
  51.         return WWHCount+1;
  52. }
  53.  
  54.  
  55.  
  56. function set(){
  57. //      VisitorName = prompt("Who are you?", "Nada");
  58. //      SetCookie ('VisitorName', VisitorName, exp);
  59.         SetCookie ('WWHCount', 0, exp);
  60.         SetCookie ('WWhenH', 0, exp);
  61. }
  62.  
  63. function getCookieVal (offset) {
  64.         var endstr = document.cookie.indexOf (";", offset);
  65.         if (endstr == -1)
  66.                 endstr = document.cookie.length;
  67.                 return unescape(document.cookie.substring(offset, endstr));
  68. }
  69.  
  70. function GetCookie (name) {
  71.         var arg = name + "=";
  72.         var alen = arg.length;
  73.         var clen = document.cookie.length;
  74.         var i = 0;
  75.         while (i < clen) {
  76.         var j = i + alen;
  77.         if (document.cookie.substring(i, j) == arg)
  78.                 return getCookieVal (j);
  79.                 i = document.cookie.indexOf(" ", i) + 1;
  80.                 if (i == 0) break;
  81.         }
  82.         return null;
  83. }
  84.  
  85. function SetCookie (name, value) {
  86.         var argv = SetCookie.arguments;
  87.         var argc = SetCookie.arguments.length;
  88.         var expires = (argc > 2) ? argv[2] : null;
  89.         var path = (argc > 3) ? argv[3] : null;
  90.         var domain = (argc > 4) ? argv[4] : null;
  91.         var secure = (argc > 5) ? argv[5] : false;
  92.         document.cookie = name + "=" + escape (value) +
  93.         ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
  94.         ((path == null) ? "" : ("; path=" + path)) +
  95.         ((domain == null) ? "" : ("; domain=" + domain)) +
  96.         ((secure == true) ? "; secure" : "");
  97. }
  98.  
  99. function DeleteCookie (name) {
  100.         var exp = new Date();
  101.         exp.setTime (exp.getTime() - 1);
  102.         // This cookie is history
  103.         var cval = GetCookie (name);
  104.         document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
  105.  
  106. }
  107. //  End Script -->
  108. </SCRIPT>
  109.  
  110. </HEAD>
  111. <BODY>
  112. <script>
  113. if (Count()==1){
  114. document.write("Ovo je prva posjeta")
  115. When()
  116. }
  117. else if (Count()>1)
  118. document.write("Zadnja posjeta je bila: <b>" + When() +"</B>.")
  119. </script>
  120.  
  121. </BODY>
  122. </HTML>

Pozdrav
↑  ↓

 Podijeli  Dodaj odgovor Stranice (4): 1, 2, 3, 4


All times are GMT +01:00. Current time: 29.03.2017-20:07.