Prikazi cijelu temu 18.02.2011 12:43
zxz Van mreze
Administrator
Registrovan od:03.02.2009
Lokacija:Tuzla


Predmet:Zoom tekst
PreuzmiIzvorni kôd (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>

Podrška samo putem foruma, jer samo tako i ostali imaju koristi od toga.