Prikazi cijelu temu 25.02.2015 19:29
zxz Van mreze
Administrator
Registrovan od:03.02.2009
Lokacija:Tuzla


Predmet:Na vrh stranice
Ovaj kod vam postavlja link da klikom na njega mozete se vratiti na vrh stranice.
PreuzmiIzvorni kôd (HTML):
  1. <TITLE>Na vrh stranice</TITLE>
  2. </HEAD>
  3. <!--
  4. var displayed="<nobr><font size=2 face=Arial><b>Na vrh</b></font></nobr>"
  5. var logolink='javascript:window.scrollTo(0,0)'
  6. var ns4=document.layers
  7. var ie4=document.all
  8. var ns6=document.getElementById&&!document.all
  9.  
  10. function regenerate(){
  11. window.location.reload()
  12. }
  13. function regenerate2(){
  14. if (ns4)
  15. setTimeout("window.onresize=regenerate",400)
  16. }
  17.  
  18. if (ie4||ns6)
  19. document.write('<span id="logo" style="position:absolute;top:-300;z-index:100">'+displayed+'</span>')
  20.  
  21. function createtext(){ //function for NS4
  22. staticimage=new Layer(5)
  23. staticimage.left=-300
  24. staticimage.document.write('<a href="'+logolink+'">'+displayed+'</a>')
  25. staticimage.document.close()
  26. staticimage.visibility="show"
  27. regenerate2()
  28. staticitns()
  29. }
  30.  
  31. function staticit(){
  32. var w2=ns6? pageXOffset+w : document.body.scrollLeft+w
  33. var h2=ns6? pageYOffset+h : document.body.scrollTop+h
  34. crosslogo.style.left=w2
  35. crosslogo.style.top=h2
  36. }
  37.  
  38. function staticit2(){
  39. staticimage.left=pageXOffset+window.innerWidth-staticimage.document.width-28
  40. staticimage.top=pageYOffset+window.innerHeight-staticimage.document.height-10
  41. }
  42.  
  43. function inserttext(){
  44. if (ie4)
  45. crosslogo=document.all.logo
  46. else if (ns6)
  47. crosslogo=document.getElementById("logo")
  48. crosslogo.innerHTML='<a href="'+logolink+'">'+displayed+'</a>'
  49. w=ns6? window.innerWidth-crosslogo.offsetWidth-20 : document.body.clientWidth-crosslogo.offsetWidth-10
  50. h=ns6? window.innerHeight-crosslogo.offsetHeight-15 : document.body.clientHeight-crosslogo.offsetHeight-10
  51. crosslogo.style.left=w
  52. crosslogo.style.top=h
  53. if (ie4)
  54. window.onscroll=staticit
  55. else if (ns6)
  56. startstatic=setInterval("staticit()",100)
  57. }
  58.  
  59. if (ie4||ns6){
  60. window.onload=inserttext
  61. window.onresize=new Function("window.location.reload()")
  62. }
  63. else if (ns4)
  64. window.onload=createtext
  65. function staticitns(){ //function for NS4
  66. startstatic=setInterval("staticit2()",90)
  67. }
  68. //-->
  69. </BODY>
  70. </HTML>

Podrska samo putem foruma, jer samo tako i ostali imaju koristi od toga.