Page 1 of 3 123 LastLast
Results 1 to 25 of 54

Thread: Javascriptbank

  1. #1
    Join Date
    Sep 2009
    Posts
    20
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Javascriptbank

    Simple game where you keep the ball from going by your paddle.... detail


    Demo: Pong

    How to setup

    Step 1: Copy & Paste CSS code below in your HEAD section
    CSS
    Code:
    <style type="text/css">
    
    body{
    background-color:white;
    font-size:10pt;
    font-family:sans-serif;
    color:#00436e;
    }
    
    </style>
    	<!--
        	This script downloaded from www.JavaScriptBank.com
        	Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
    	-->
    Step 2: Copy & Paste HTML code below in your BODY section
    HTML
    Code:
    <script language="javascript">
    var xincr=17;           // PIXELS STEPS ACROSS
    var yincr=13;           // PIXEL STEPS VERTICAL
    var yoffset=65;        // OFFSET FROM THE TOP OF THE PAGE. WILL BE AUTO CENTERED HORIZONTALLY.
    
    var w3c=(document.getElementById)?true:false;
    var ns4=(document.layers)?true:false;
    var ie4=(document.all && !w3c)?true:false;
    var ie5=(document.all && w3c)?true:false;
    var ns6=(w3c && navigator.appName.indexOf("Netscape")>=0)?true:false;
    
    var paddley, x, y, w_x, w_y, id1, py=0, missed=1, xdir=false, ydir=true, started=false;
    var outer, paddle, field, pc, ball;
    
    function getid(id){
    if(ns4) return findlayer(id,document);
    else if(ie4)return document.all[id];
    else return document.getElementById(id);
    }
    
    // FUNCTION TO FIND NESTED LAYERS IN NS4 BY MIKE HALL
    function findlayer(name,doc){
    var i,layer;
    for(i=0;i<doc.layers.length;i++){
    layer=doc.layers[i];
    if(layer.name==name)return layer;
    if(layer.document.layers.length>0)if((layer=findlayer(name,layer.document))!=null)return layer;
    }
    return null;
    }
    
    function moveidto(id,x,y){
    if(ns4)id.moveTo(x,y);
    else{
    id.style.left=x+'px';
    id.style.top=y+'px';
    }}
    
    function showid(id){
    if(ns4)id.visibility="show";
    else id.style.visibility="visible";
    }
    
    function youmissed(){
    x+=xincr;
    (ydir)? y+=yincr: y-=yincr;
    moveball();
    clearInterval(id1);
    alert('You missed!\n\nTotal misses so far: '+(missed++)+'\n\nPress Ok to continue..');
    id1=setInterval('animate()',100);
    x=200;
    y=100;
    xdir=false;
    ydir=true;
    moveball();
    }
    
    function startpause(){
    if(started){
    started=false;
    clearInterval(id1);
    if(!ns4)document.f.sp.value=" Game Paused... ";
    }else{
    started=true;
    if(!ns4)document.f.sp.value=" Press to Pause ";
    id1=setInterval('animate()',100);
    }}
    
    function animate(){
    if(ns4){
    x=ball.left;
    y=ball.top;
    paddley=paddle.top;
    }else{
    y=parseInt(ball.style.top);
    x=parseInt(ball.style.left);
    paddley=parseInt(paddle.style.top);
    }
    if(( ( (y<paddley-7)&&(x>=370) ) || ( (y>paddley+37)&&(x>=370) ) )) youmissed();
    else{
    if(ydir){
    if(y+yincr > 190){y=190; ydir=false; }else{y+=yincr}
    }else{
    if(y-yincr < 0){y=0; ydir=true; }else{y-=yincr}
    }
    if(xdir){
    if(x+xincr > 370){x=370; xdir=false}else{x+=xincr}
    }else{
    if(x-xincr < 20){x=20; xdir=true;}else{x-=xincr}
    }
    moveball();
    }}
    
    function moveball(){
    if((y-20<=160)&&(y-20>=0))moveidto(pc,0,y-20);
    moveidto(ball,x,y);
    }
    
    function movepaddle(evnt){
    py=((ie4||ie5)?event.clientY:evnt.pageY)-40-yoffset;
    if((py>=0)&&(py<=160))moveidto(paddle,380,py);
    return false;
    }
    
    window.onresize=function(){
      if(ns4)setTimeout('history.go(0)',400);
      else resize();
    }
    
    function resize(){
    var ww=(ie4||ie5)?document.body.clientWidth:window.innerWidth;
    moveidto(outer,(ww-400)/2, yoffset);
    }
    
    window.onload=function(){
    paddle=getid('paddle');
    field=getid('field');
    pc=getid('pc');
    ball=getid('ball');
    outer=getid('outer');
    resize();
    moveidto(paddle,380,0);
    moveidto(pc,0,0);
    moveidto(ball,200,100)
    x=200;
    y=100;
    showid(ball);
    showid(pc);
    showid(field);
    showid(paddle);
    if(ns4)document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove=movepaddle;
    alert('INSTRUCTIONS\n\n- Use the paddle and try to keep the ball from hitting the wall.\n- Use the mouse to move the paddle. You do not need to click the paddle to move it.\n- Press the "Start" button to start/pause the game.\n- The game will keep track of your misses.');
    }
    
    var txt=(ns4)?'<layer name="outer" visibility="visible" width="400" height="300">':'<div id="outer" style="position:absolute; width:400px; height:300px">';
    txt+=(ns4)?'<layer name="ball" visibility="hidden" z-index="4"><img src="ball.gif"></layer>':'<div id="ball" style="position:absolute; visibility:hidden; z-index:10"><img src="ball.gif"></div>';
    txt+=(ns4)?'<layer name="paddle" visibility="hidden" z-index="2"><img src="paddle.gif"></layer>':'<div id="paddle" style="position:absolute; visibility:hidden; z-index:5"><img src="paddle.gif"></div>';
    txt+=(ns4)?'<layer name="pc" visibility="hidden" z-index="3"><img src="paddle.gif"></layer>':'<div id="pc" style="position:absolute; visibility:hidden; z-index:5"><img src="paddle.gif"></div>';
    txt+=(ns4)?'<layer name="field" left="0" top="0" left="0" visibility="hidden" bgcolor="black" z-index="1" width="400" height="200"></layer>':'<div id="field" style="position:absolute; top:0px; left:0px; visibility:hidden; width:400px; height:200px; z-index:2; background-color:black;"></div>';
    txt+=(ns4)?'<layer name="text" top="220" left="0">':'<div id="text" style="position:absolute; top:220px; width:400px;">';
    txt+='<table border="0" width="400"><tr><td align="center"><form name="f"><input type="button" name="sp" value="  Start / Pause  " onClick="startpause()"></form></td></tr></table>';
    txt+=(ns4)?'</layer>':'</div>';
    txt+=(ns4)?'</layer>':'</div>';
    document.write(txt);
    </script>
    	<!--
        	This script downloaded from www.JavaScriptBank.com
        	Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
    	-->
    Step 3: must download files below
    Files
    ball.gif
    paddle.gif







  2. #2
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Impossible to score :S

  3. #3
    Join Date
    Sep 2009
    Posts
    20
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    oh, really? but I did

  4. #4
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Quote Originally Posted by JavaScriptBank View Post
    oh, really? but I did
    I doubt that. There is no code for you scoring, only you missing. That, and the computer's paddle perfectly tracks the ball, so it can't miss.

  5. #5
    Join Date
    Sep 2009
    Posts
    20
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Dynamic Combo Box

    This simple JavaScript creates a drop-down JavaScript menu that opens pages on a single click and [URL="http://www.javascriptbank.com/javascript/form/button/"]button</... detail


    How to setup

    Step 1: Place JavaScript below in your HEAD section
    JavaScript
    Code:
    <script>
    <!--  
    //DEFINE the group of links for display in the combo
    //EXTEND each array and its elements as needed
    //BE sure to follow the pattern revealed below
    var combo1=new Array()
    combo1[0]=new Option("Game.TrucTuyen.org","http://Game.TrucTuyen.org")
    combo1[1]=new Option("JavaScriptBank.com","http://JavaScriptBank.com")
    combo1[2]=new Option("Freewarejava.com","http://www.freewarejava.com")
    combo1[3]=new Option("Free Web Templates","http://www.freewebtemplates.com")
    combo1[4]=new Option("Web Monkey","http://www.webmonkey.com")
    
    var combo2=new Array()
    combo2[0]=new Option("CNN","http://www.cnn.com")
    combo2[1]=new Option("MSNBC","http://www.msnbc.com")
    combo2[2]=new Option("BBC News","http://news.bbc.co.uk")
    combo2[3]=new Option("ABC News","http://www.abcnews.com")
    
    var combo3=new Array()
    combo3[0]=new Option("Hollywood.com","http://www.hollywood.com")
    combo3[1]=new Option("MTV","http://www.mtv.com")
    combo3[2]=new Option("ETOnline","http://etonline.com")
    
    
    var cacheobj=document.dynamiccombo.stage2
    
    function populate(x){
    for (m=cacheobj.options.length-1;m>0;m--)
    cacheobj.options[m]=null
    selectedarray=eval(x)
    for (i=0;i<selectedarray.length;i++)
    cacheobj.options[i]=new Option(selectedarray[i].text,selectedarray[i].value)
    cacheobj.options[0].selected=true
    }
    
    function gothere(){
    location=cacheobj.options[cacheobj.selectedIndex].value
    }
    
    //SHOW first combo by default
    populate(combo1)
    
    //-->
    </script>
    	<!--
        	This script downloaded from www.JavaScriptBank.com
        	Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
    	-->
    Step 2: Place HTML below in your BODY section
    HTML
    Code:
    <form name="dynamiccombo">
    
    <select name="stage2" size="1">
    <option value="#">This is a Place Holder</option>
    <option value="#">This is a Place Holder</option>
    <option value="#">This is a Place Holder</option>
    </select>
    <input type="button" name="test" value="Go!"
    onClick="gothere()">
    </form>
    <!--SET up your links, and pass in the name of the group (ie: combo1) you wish to display for the link in question-->
    <a href="javascript:populate(combo1)">Webmaster sites</a> | <a href="javascript:populate(combo2)">
    News sites</a> | <a href="javascript:populate(combo3)">Entertainment</a>
    	<!--
        	This script downloaded from www.JavaScriptBank.com
        	Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
    	-->






  6. #6
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Not to be mean, but your JS is written horribly. Looks like it should work, just needs to be cleaned up.

    ~Camo
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  7. #7
    Join Date
    Sep 2008
    Posts
    241
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Lol.
    Agreed on the formatting part.

    So, what's the point of this post?

    Also, I like PHP better for this job.
    It is supported MUCH more than JavaScript (yes, and you oldies using IE6 can visit PHP sites).

    Just saying...
    PM me if you need any help with math.
    I can try to help you with anything!


  8. #8
    Join Date
    Sep 2009
    Posts
    20
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default JavaScript Countdown Timer

    This JavaScript displays a countdown timer and alerts the user when the timer reaches zero. It then redirects to another Web ... detail


    How to setup

    Step 1: Place CSS below in your HEAD section
    CSS
    css Code:
    <style type="text/css">
    #txt {
      border:none;
      font-family:verdana;
      font-size:16pt;
      font-weight:bold;
      border-right-color:#FFFFFF
    }

    </style>
        <!--
            This script downloaded from [URL="http://www.JavaScriptBank.com"]www.JavaScriptBank.com[/URL]
            Come to view and download over 2000+ free javascript at [URL="http://www.JavaScriptBank.com"]www.JavaScriptBank.com[/URL]
        -->
    Step 2: Copy & Paste JavaScript code below in your HEAD section
    JavaScript
    javascript Code:
    <script language="javascript">
    // Created by: Neill Broderick :: [url]http://www.bespoke-software-solutions.co.uk/downloads/downjs.php[/url]

    var mins
    var secs;

    function cd() {
         mins = 1 * m("10"); // change minutes here
         secs = 0 + s(":01"); // change seconds here (always add an additional second to your total)
         redo();
    }

    function m(obj) {
         for(var i = 0; i < obj.length; i++) {
              if(obj.substring(i, i + 1) == ":")
              break;
         }
         return(obj.substring(0, i));
    }

    function s(obj) {
         for(var i = 0; i < obj.length; i++) {
              if(obj.substring(i, i + 1) == ":")
              break;
         }
         return(obj.substring(i + 1, obj.length));
    }

    function dis(mins,secs) {
         var disp;
         if(mins <= 9) {
              disp = " 0";
         } else {
              disp = " ";
         }
         disp += mins + ":";
         if(secs <= 9) {
              disp += "0" + secs;
         } else {
              disp += secs;
         }
         return(disp);
    }

    function redo() {
         secs--;
         if(secs == -1) {
              secs = 59;
              mins--;
         }
         document.cd.disp.value = dis(mins,secs); // setup additional displays here.
         if((mins == 0) && (secs == 0)) {
              window.alert("Time is up. Press OK to continue."); // change timeout message as required
              // window.location = "yourpage.htm" // redirects to specified page once timer ends and ok button is pressed
         } else {
             cd = setTimeout("redo()",1000);
         }
    }

    function init() {
      cd();
    }
    window.onload = init;
    </script>
        <!--
            This script downloaded from [url]www.JavaScriptBank.com[/url]
            Come to view and download over 2000+ free javascript at [url]www.JavaScriptBank.com[/url]
        -->
    Step 3: Place HTML below in your BODY section
    HTML
    html Code:
    <form name="cd">
    <input id="txt" readonly="true" type="text" value="10:00" border="0" name="disp">
    </form>
        <!--
            This script downloaded from [url]www.JavaScriptBank.com[/url]
            Come to view and download over 2000+ free javascript at [url]www.JavaScriptBank.com[/url]
        -->
    Last edited by Markus; 10-13-2009 at 02:57 PM.

  9. #9
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Wouldnt it just be easier to have Javascript Tutorials and link it to http://www.javascriptbank.com/javascript/ ? Rather than copying and pasting from the site?

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  10. #10
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Again, work on your JS formatting :/ Here is a countdown that I wrote a couple of months back, you can pause and start and reset.

    Code:
    <html>
        <head>
            <title>24 hour Timer</title>
            <link href="style.css" rel="stylesheet" type="text/css" >
            <script type="text/javascript">
                // designed by JavaScript Archive, (c)1999
                // Get more free javascripts at http://jsarchive.8m.com
               
                var aySound = new Array();
                // Below: source for sound files to be preloaded
                aySound[0] = "explosion.wav";
                aySound[1] = "machinegun.mp3";
               
                // DO NOT edit below this line
                document.write('<BGSOUND ID="auIEContainer">')
                IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
                NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
                ver4 = IE||NS? 1:0;
                onload=auPreload;
    
                function auPreload() {
                    if (!ver4) return;
                    if (NS) auEmb = new Layer(0,window);
                    else {
                        Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
                        document.body.insertAdjacentHTML("BeforeEnd",Str);
                    }
                    var Str = '';
                    for (i=0;i<aySound.length;i++)
                        Str += "<EMBED SRC='"+aySound[i]+"' AUTOSTART='FALSE' HIDDEN='TRUE'>"
                    if (IE) auEmb.innerHTML = Str;
                    else {
                        auEmb.document.open();
                        auEmb.document.write(Str);
                        auEmb.document.close();
                    }
                        auCon = IE? document.all.auIEContainer:auEmb;
                        auCon.control = auCtrl;
                }
               
                function auCtrl(whSound,play) {
                    if (IE) this.src = play? aySound[whSound]:'';
                    else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"))
                }
    
                function playSound(whSound) { if (window.auCon) auCon.control(whSound,true); }
                function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); }
               
                //END OF SOUND FUNCTIONS (borrowed script)    
    
                var seconds = 0;
                var minutes = 0;
                var hours = 0;
                var totalSeconds = 0;
                var t
    
                function setTime(a, b, c) {
                    hours = parseInt(c) * (60 * 60);
                    minutes = parseInt(b) * 60;
                    seconds = parseInt(a);
    
                    totalSeconds = parseInt(seconds+minutes+hours);
    
                    document.getElementById("secondOutput").innerHTML = totalSeconds;
                    frmSetTime.reset;
                   
                    return seconds;
                }
               
                function startTimer() {                
                    if(document.getElementById("secondOutput").innerHTML> 0) {
                        document.getElementById("secondOutput").innerHTML-=1;
                        t = window.setTimeout(function(){startTimer()}, 1000);
                        //seconds=seconds-1;
                    }
                    else {
                        playSound(1);
                    }
                }
               
                function pauseTimer() {
                    clearTimeout(t);
                }
    
    	    function resetForm() {
      		frmSetTime.hours.value = 0;
      		frmSetTime.minutes.value = 0;
      		frmSetTime.seconds.value = 0;
    	    }
            </script>
        </head>
        <body>        
            <div id="gadgetContent">
                <div id="secondOutput">0</div>
                    <table style="width: 100%">
                        <tr>
                            <td>Hrs</td>
                            <td>Min</td>
                            <td>Sec</td>
                        </tr>
                        <form name="frmSetTime" style="font-family: Arial, Helvetica, sans-serif; font-size: .1em;" action="#">
                        <tr>
                            <td width="33%">
                                <select name="hours">
                                    <option value="0">0</option>
                                    <option value="1">1</option>
                                    <option value="2">2</option>
                                    <option value="3">3</option>
                                    <option value="4">4</option>
                                    <option value="5">5</option>
                                </select>
                            </td>
                            <td width="33%">
                                <select name="minutes">
                                    <option value="0">0</option>
                                    <option value="1">1</option>
                                    <option value="2">2</option>
                                    <option value="3">3</option>
                                    <option value="4">4</option>
                                    <option value="5">5</option>
                                </select>
                            </td>
                            <td>
                                <select name="seconds">
                                    <option value="0">0</option>
                                    <option value="1">1</option>
                                    <option value="2">2</option>
                                    <option value="3">3</option>
                                    <option value="4">4</option>
                                    <option value="5">5</option>
                                </select>
                            </td>
                        </tr>
                    </form>
                </table>                      
                <input type="button" value="Set" onclick="setTime(frmSetTime.seconds.value, frmSetTime.minutes.value, frmSetTime.hours.value);" >
                <input type="reset" value="Reset" onclick="setTime(0, 0, 0); resetForm();">
                <input type="button" value="Start" onclick="startTimer();">
                <input type="button" value="Pause" onclick="pauseTimer();">
            </div>
        </body>
    </html>
    ~Camo
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  11. #11
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Isn't this some bot?



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  12. #12
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    I took the liberty to use the highlight tags to let your code be highlighted properly
    I made a new script, check it out!.

  13. #13
    Join Date
    Sep 2009
    Posts
    20
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    no, I'm not bot, I'm real human

    @Camo Developer: can you submit your JavaScript code (+ a little description) to my library for everyone?

  14. #14
    Join Date
    Nov 2007
    Posts
    47
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Your host has been suspended ... bad luck dude.

  15. #15
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This Account Has Been Suspended

    Lawl.

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  16. #16
    Join Date
    Sep 2009
    Posts
    20
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Image slideshow transition

    This JavaScript creates slideshow effect with one of transitions.... detail


    How to setup

    Step 1: Place JavaScript below in your HEAD section
    JavaScript
    Code:
    <script LANGUAGE="JavaScript1.1">
    <!-- Beginning of JavaScript -
    
    messages = new Array()
    //anh dung de tao hieu ung
    messages[0] = "<img src=logojs.gif>"
    messages[1] = "<img src=photo1.jpg>"
    messages[2] = "<img src=photo2.jpg>"
    messages[3] = "<img src=photo3.jpg>"
    messages[4] = "<img src=photo4.jpg>"
    
    var i_messages = 0
    var timer
    
    function dotransition() {
        if (document.all) {
            content.filters[0].apply()
            content.innerHTML = messages[i_messages]
            content.filters[0].play()
            if (i_messages >= messages.length-1) {
                i_messages = 0
            }
            else {
                i_messages++
            }
        } 
        
        if (document.layers) {
           document.nn.document.write("<table cellspacing=2 cellpadding=2 border=0><tr><td align=left>"+messages[i_messages]+"</td></tr></table>")
    		document.close()
            if (i_messages >= messages.length-1) {
                i_messages = 0
            }
            else {
                i_messages++
            }
        } 
        timer = setTimeout("dotransition()",5000)   
    }
    // - End of JavaScript - -->
    </script>
    	<!--
        	This script downloaded from www.JavaScriptBank.com
        	Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
    	-->
    Step 2: Copy & Paste HTML code below in your BODY section
    HTML
    Code:
    <BODY onload="dotransition()">
    <DIV id=content style="position: relative; width:160px; height:240px; text-align:center; filter: revealTrans(Transition=12, Duration=3)"></DIV>
    </BODY>
    	<!--
        	This script downloaded from www.JavaScriptBank.com
        	Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
    	-->






  17. #17
    Join Date
    Sep 2009
    Posts
    20
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Make link open in new tab/window

    Use this simple JavaScript to make all links on your web pages open in new tab/window. Script is easy to setup, you should save them into a f... detail


    How to setup

    Step 1: Place JavaScript below in your HEAD section
    JavaScript
    Code:
    <script language=javascript>
    /*
    	Kevin Yank
    	http://www.sitepoint.com/authorcontact/48
    */
    function externalLinks()
    {
      if (!document.getElementsByTagName) return;
      var anchors = document.getElementsByTagName("a");
      for (var i=0; i<anchors.length; i++)
      {
          var anchor = anchors[i];
          if(anchor.getAttribute("href"))
    		anchor.target = "_blank";
      }
    }
    window.onload = externalLinks;
    
    </script>
    	<!--
        	This script downloaded from www.JavaScriptBank.com
        	Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
    	-->
    Step 2: Place HTML below in your BODY section
    HTML
    Code:
    <a href="http://javascriptbank.com/">Home</a> | 
    	<a href="http://javascriptbank.com/4rum/">Forum</a> | 
    	<a href="http://javascriptbank.com/javascript/">JavaScript</a> | 
    	<a href="http://javascriptbank.com/service/">Services</a> | 
    	<a href="http://javascriptbank.com/javascript/submit-javascript-bank.html">Submit script</a> | 
    	<a href="http://javascriptbank.com/thietkeweb/javascriptmall/">Documentary</a> | 
    	<a href="http://javascriptbank.com/javascript/contact-javascript-bank.html">Contact us</a> | 
    	<a href="http://javascriptbank.com/javascript/aboutus-javascript-bank.html">About us</a>
    	<!--
        	This script downloaded from www.JavaScriptBank.com
        	Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
    	-->






  18. #18
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    It's better to do it selectively by just putting:
    HTML Code:
    target="_blank"
    in the anchor of the link..
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  19. #19
    Join Date
    Oct 2009
    Location
    Melb, Australia
    Posts
    179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Sex View Post
    It's better to do it selectively by just putting:
    HTML Code:
    target="_blank"
    in the anchor of the link..
    ^That and:
    You should never really rely on javascript when making a website.

  20. #20
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    True, because it might not work in some browsers (as some may have it turned off in the options).

    Anyways, I think this is a bot or something.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  21. #21
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Quote Originally Posted by Sex View Post
    True, because it might not work in some browsers (as some may have it turned off in the options).

    Anyways, I think this is a bot or something.
    He's posted before saying that he's not a bot.

  22. #22
    Join Date
    Oct 2009
    Location
    Melb, Australia
    Posts
    179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Sex View Post
    True, because it might not work in some browsers (as some may have it turned off in the options).

    Anyways, I think this is a bot or something.

    Yeh I use the firefox addon "NoScript" to prevent malicious scripts which in turn causes many sites that rely on javascript to not operate/show as they should.

  23. #23
    Join Date
    Sep 2009
    Posts
    20
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default AJAX Page Content Loader

    AJAX - a very great web development technology nowaday. Use this AJAX in order to load XML and HTML files on the same website with XMLHttpRequest. And in the <code>body... detail at JavaScriptBank.com - 2.000+ free JavaScript codes


    How to setup

    Step 1: CSS below for styling thescript, place it into HEAD section
    CSS
    Code:
    <style type="text/css">
    <!--
    #contentLYR {
      position:relative;/*
      width:200px;
      height:115px;
      left: 200px;
      top: 200px;*/
      z-index:1;
    }
    -->
    </style>
    Step 2: Place JavaScript below in your HEAD section
    JavaScript
    Code:
    <script type="text/javascript">
    <!-- Begin
    /*
         This script downloaded from www.JavaScriptBank.com
         Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
    */
    
    // Created by: Eddie Traversa (2005) :: http://dhtmlnirvana.com/
    function ajaxLoader(url,id) {
      if (document.getElementById) {
        var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
      }
      if (x) {
        x.onreadystatechange = function() {
          if (x.readyState == 4 && x.status == 200) {
            el = document.getElementById(id);
            el.innerHTML = '<JavaScriptBank>This is content of demo.xml file</JavaScriptBank>';//x.responseText;
          }
        }
        x.open("GET", url, true);
        x.send(null);
      }
    }
    //-->
    </script>
    Step 3: Copy & Paste HTML code below in your BODY section
    HTML
    Code:
    <div id="contentLYR"></div>
    	<script>window.onload = function(){ajaxLoader('demo.xml','contentLYR');}</script>
    Step 4: downloads
    Files
    demo.xml







  24. #24
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Bot ^
    Verrekte Koekwous

  25. #25
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    Quote Originally Posted by mastaraymond View Post
    Bot ^
    Semi-bot, he made two actual replies to something.
    I made a new script, check it out!.

Page 1 of 3 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •