• Rejestracja
vBHELP.pl - polskie wsparcie vBulletin
  1. #1
    David jest nieaktywny Użytkownik
    Dołączył
    Feb 2010
    Posty
    65

    Domyślnie Jak Zainstalować Modyfikację JavaScript(Rainbow)

    Witam mam tutaj pewien kod trochę długi dla tego zastanawia mnie to,że raczej nie można go dodać do boxu trzeciego usergorup Html Markup wiem że jakoś się to robi bo widziałem na innych forach że działa ta modyfikacja tylko jak ona jest zrobiona
    tutaj na tej stronie zobaczycie o co mi chodzi dokładnie

    The JavaScript Source: Text Effects: myRainbowSpan
    o ten efekt jak dodać go do usergroup?? bardzo proszę o pomoc dziękuje Pozdrawiam David

    Kod:
    <!-- TWO STEPS TO INSTALL MYRAINBOWSPAN:
    
      1.  Copy the coding into the HEAD of your HTML document
      2.  Add the last code into the BODY of your HTML document  -->
    
    <!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->
    
    <HEAD>
    
    <script type="text/javascript">
    <!-- Begin
    /* This script and many more are available free online at
    The JavaScript Source!! http://javascript.internet.com
    Created by: HaganeNoKokoro :: http://tinyurl.com/buvp9 */
    
    /*
     * Notes on hue
     *
     * This script uses hue rotation in the following manner:
     * hue=0   is red (#FF0000)
     * hue=60  is yellow (#FFFF00)
     * hue=120 is green (#00FF00)
     * hue=180 is cyan (#00FFFF)
     * hue=240 is blue (#0000FF)
     * hue=300 is magenta (#FF00FF)
     * hue=360 is hue=0 (#FF0000)
     *
     * Notes on the script
     *
     * This script should function in any browser that supports document.getElementById
     * It has been tested in Netscape7, Mozilla Firefox 1.0, and Internet Explorer 6
     *
     * Accessibility
     *
     * The script does not write the string out, but rather takes it from an existing
     * HTML element. Therefore, users with javascript disabled will not be adverely affected.
     * They just won't get the pretty colors.
     */
    
    /*
     * splits par.firstChild.data into 1 span for each letter
     * ARGUMENTS
     *   span - HTML element containing a text node as the only element
     */
    function toSpans(span) {
      var str=span.firstChild.data;
      var a=str.length;
      span.removeChild(span.firstChild);
      for(var i=0; i<a; i++) {
        var theSpan=document.createElement("SPAN");
        theSpan.appendChild(document.createTextNode(str.charAt(i)));
        span.appendChild(theSpan);
      }
    }
    
    /*
     * creates a rainbowspan object
     * whose letters will be colored [deg] degrees of hue
     * ARGUMENTS
     *   span - HTML element to apply the effect to (text only, no HTML)
     *   hue - what degree of hue to start at (0-359)
     *   deg - how many hue degrees should be traversed from beginning to end of the string (360 => once around, 720 => twice, etc)
     *   brt - brightness (0-255, 0 => black, 255 => full color)
     *   spd - how many ms between moveRainbow calls (less => faster)
     *   hspd - how many hue degrees to move every time moveRainbow is called (0-359, closer to 180 => faster)
     */
    function RainbowSpan(span, hue, deg, brt, spd, hspd) {
        this.deg=(deg==null?360:Math.abs(deg));
        this.hue=(hue==null?0:Math.abs(hue)%360);
        this.hspd=(hspd==null?3:Math.abs(hspd)%360);
        this.length=span.firstChild.data.length;
        this.span=span;
        this.speed=(spd==null?50:Math.abs(spd));
        this.hInc=this.deg/this.length;
        this.brt=(brt==null?255:Math.abs(brt)%256);
        this.timer=null;
        toSpans(span);
        this.moveRainbow();
    }
    
    /*
     * sets the colors of the children of [this] as a hue-rotating rainbow starting at this.hue;
     * requires something to manage ch externally
     * I had to make the RainbowSpan class because M$IE wouldn't let me attach this prototype to [Object]
     */
    RainbowSpan.prototype.moveRainbow = function() {
      if(this.hue>359) this.hue-=360;
      var color;
      var b=this.brt;
      var a=this.length;
      var h=this.hue;
    
      for(var i=0; i<a; i++) {
    
        if(h>359) h-=360;
    
        if(h<60) { color=Math.floor(((h)/60)*b); red=b;grn=color;blu=0; }
        else if(h<120) { color=Math.floor(((h-60)/60)*b); red=b-color;grn=b;blu=0; }
        else if(h<180) { color=Math.floor(((h-120)/60)*b); red=0;grn=b;blu=color; }
        else if(h<240) { color=Math.floor(((h-180)/60)*b); red=0;grn=b-color;blu=b; }
        else if(h<300) { color=Math.floor(((h-240)/60)*b); red=color;grn=0;blu=b; }
        else { color=Math.floor(((h-300)/60)*b); red=b;grn=0;blu=b-color; }
    
        h+=this.hInc;
    
        this.span.childNodes[i].style.color="rgb("+red+", "+grn+", "+blu+")";
      }
      this.hue+=this.hspd;
    }
    // End -->
    </script>
    </HEAD>
    
    <!-- STEP TWO: Copy this code into the BODY of your HTML document  -->
    
    <BODY>
    
    <div align="center">
    <h3 id="r1">This is a test of the RainbowSpan system</h3>
    </div>
    <script type="text/javascript">
    var r1=document.getElementById("r1"); //get span to apply rainbow
    var myRainbowSpan=new RainbowSpan(r1, 0, 360, 255, 50, 18); //apply static rainbow effect
    myRainbowSpan.timer=window.setInterval("myRainbowSpan.moveRainbow()", myRainbowSpan.speed);
    </script>
    
    <div align="center">
    <p id="r2">If you don't see a nifty moving rainbow above, then your browser doesn't understand my JavaScript.</p>
    </div>
    <script type="text/javascript">
    var r2=document.getElementById("r2"); //get span to apply rainbow
    var myRainbowSpan2=new RainbowSpan(r2, 0, 360, 255, 50, 348); //apply static rainbow effect
    myRainbowSpan2.timer=window.setInterval("myRainbowSpan2.moveRainbow()", myRainbowSpan2.speed);
    </script>
    
    <p><center>
    <font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
    by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
    </center><p>
    
    <!-- Script Size:  4.85 KB -->



  2. #2
    Marek jest nieaktywny Banned
    Dołączył
    May 2008
    Przegląda
    Where my hat is
    Posty
    0
    Przydatne posty
    26

    Domyślnie

    Takie efekty na forum? Przecież karnawał dawno już się skończył. vBulletin jest - moim zdaniem - zbyt poważnym skryptem by go profanować tego typu świecidełkami.


  3. #3
    David jest nieaktywny Użytkownik
    Dołączył
    Feb 2010
    Posty
    65

    Domyślnie

    Hmm dobrze ale mi się podoba :P moje forum jest przeznaczone pewnej grze dla tego pasowało by, powiesz mi może czy da się coś takiego zrobić czy się nie da??


  4. #4
    Awatar error
    error jest nieaktywny Stały bywalec
    Dołączył
    Jul 2008
    Posty
    197
    Przydatne posty
    2

    Domyślnie

    Spróbuj dodac to

    <font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
    by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
    Gdyż w instrukcji pisze cos

    2. Add the last code into the BODY of your HTML document -->

    A reszte powinienes chyba dodac gdzies do szablonu


  5. #5
    David jest nieaktywny Użytkownik
    Dołączył
    Feb 2010
    Posty
    65

    Domyślnie

    hmm gdzieś do szablonu a wiesz dokładnie gdzie?? bo jak dodaje do headera robi mi się wielki syf czyli psuje mi sie styl cały :/


  6. #6
    David jest nieaktywny Użytkownik
    Dołączył
    Feb 2010
    Posty
    65

    Domyślnie

    Mam nadzieję że ktoś mi pomoże no chyba że zna inny podobny efekt na vb forum dziękuje


Podobne wątki

  1. Jak zainstalować modyfikację / hack
    By Max in forum Artykuły | FAQ
    Odpowiedzi: 6
    Ostatni post / autor: 29.08.2011, 18:25
  2. Jak Zainstalować tąmodyfikacje
    By David in forum Pytania i problemy
    Odpowiedzi: 2
    Ostatni post / autor: 22.03.2010, 17:01
  3. Jak zainstalować vbulletin 1.1.5
    By Marek607 in forum Luźne dyskusje
    Odpowiedzi: 6
    Ostatni post / autor: 16.08.2009, 19:08
  4. Jak zainstalować spolszczenie?
    By Bluray in forum Pytania i problemy
    Odpowiedzi: 1
    Ostatni post / autor: 22.05.2008, 20:35
  5. vB Ad Management 3.1.1 jak zainstalować?
    By makaveli23 in forum Pytania i problemy
    Odpowiedzi: 0
    Ostatni post / autor: 06.02.2008, 12:02
Chmurka.pl

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67