Receta Gatimi

Scripte ne JavaScript


+ Pėrgjigju tek Diskutimi
Rezultatet nga 1 deri tek 3 prej 3
  1. #1
    iii pazevendesueshem! Super Mod Maska e ReniX
    Anėtarėsimi
    Nov 2006
    Vendndodhja
    Fi-IT
    Postime
    14,359
    Gjinia
    Mashkull
    Reputacioni
    36

    Scripte ne JavaScript

    per te printuar nje faqe:
    Kodi:
    <a href=\'javascript:;\' onClick=\'window.print();return false\'>Printo faqe.</a>
    Shtoje ne preferimet:
    Ora ne nje faqe:
    Kodi:
    <script language="Javascript">
    <!--
    var timerID = null;
    var timerRunning = false;
    function stopclock (){
            if(timerRunning)
                    clearTimeout(timerID);
            timerRunning = false;
    }
    
    function startclock () {
            stopclock();
            showtime();
    }
    
    function showtime () {
            var now = new Date();
            var hours = now.getHours();
            var minutes = now.getMinutes();
            var seconds = now.getSeconds()
            var timeValue = "" + ((hours >12) ? hours -12 :hours)
            timeValue += ((minutes < 10) ? ":0" : ":") + minutes
            timeValue += ((seconds < 10) ? ":0" : ":") + seconds
            timeValue += (hours >= 12) ? "Pasdite" : "Paradite"
            document.clock.face.value = timeValue;
            timerID = setTimeout("showtime()",1000);
            timerRunning = true;
    }
    //-->
    
    </script>
    <body onLoad="startclock()">
    <center>
    <form name="clock" onSubmit="0">
    <input type="text" name="face" size=14 value="">
    </form>
    </center>
    Shfaq daten ne faqe:
    Kodi:
    <script language="JavaScript">
    <!--
    function makeArray() {
    for (i = 0; i<makeArray.arguments.length; i++)
    this[i + 1] = makeArray.arguments[i];
    }
    var months = new makeArray(\'Janar\',\'Shkurt\',\'Mars\',\'Prill\',\'Maj\',\'Qeshor\', \'korrik\',\'Gusht\',\'Shtator\',\'tetor\',\'Nentor\',\'Dhjetor\');
    var date = new Date();
    var day = date.getDate();
    var month = date.getMonth() + 1;
    var yy = date.getYear();
    var year = (yy < 1000) ? yy + 1900 : yy;
    document.write(day + " " + months[month] + " " + year);
    //-->
    </script>

  2. #2
    iii pazevendesueshem! Super Mod Maska e ReniX
    Anėtarėsimi
    Nov 2006
    Vendndodhja
    Fi-IT
    Postime
    14,359
    Gjinia
    Mashkull
    Reputacioni
    36

    Re: Scripte ne JavaScript

    Ndalon klikimet me butonin e djathte te musit:
    Kodi:
    <script language="JavaScript1.1"><!-- Begin
    function right(e) {if (navigator.appName == \'Netscape\' && 
    (e.which == 3 || e.which == 2))
    return false;
    else if (navigator.appName == \'Microsoft Internet Explorer\' && 
    (event.button == 2 || event.button == 3)) {
    alert(Te gjitha te drejtat e rezervuara\');
    return false;
    }
    return true;
    }
    
    document.onmousedown=right;
    if (document.layers) window.captureEvents(Event.MOUSEDOWN);
    window.onmousedown=right;
    // End -->
    </script>
    Buton qe Mbyll faqet:
    Kodi:
    <form>
    <input type="button" value="Close Window" onClick="window.close()">
    </form>

  3. #3
    iii pazevendesueshem! Super Mod Maska e ReniX
    Anėtarėsimi
    Nov 2006
    Vendndodhja
    Fi-IT
    Postime
    14,359
    Gjinia
    Mashkull
    Reputacioni
    36

    Re: Scripte ne JavaScript

    Efekt shiu mbi tekst:
    Kodi:
    <body>
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    var no = 50;
    var speed = 1;
    var ns4up = (document.layers) ? 1 : 0;
    var ie4up = (document.all) ? 1 : 0;
    var s, x, y, sn, cs;
    var a, r, cx, cy;
    var i, doc_width = 800, doc_height = 600;
    if (ns4up) {
    doc_width = self.innerWidth;
    doc_height = self.innerHeight;
    }
    else
    if (ie4up) {
    doc_width = document.body.clientWidth;
    doc_height = document.body.clientHeight;
    }
    x = new Array();
    y = new Array();
    r = new Array();
    cx = new Array();
    cy = new Array();
    s = 8;
    for (i = 0; i < no; ++ i) {
    initRain();
    if (ns4up) {
    if (i == 0) {
    document.write("<layer name=\"dot"+ i +"\" left=\"1\" ");
    document.write("top=\"1\" visibility=\"show\"><font color=\"blue\">");
    document.write(",</font></layer>");
    }
    else {
    document.write("<layer name=\"dot"+ i +"\" left=\"1\" ");
    document.write("top=\"1\" visibility=\"show\"><font color=\"blue\">");
    document.write(",</font></layer>");
       }
    }
    else
    if (ie4up) {
    if (i == 0) {
    document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
    document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
    document.write("visible; TOP: 15px; LEFT: 15px;\"><font color=\"blue\">");
    document.write(",</font></div>");
    }
    else {
    document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
    document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
    document.write("visible; TOP: 15px; LEFT: 15px;\"><font color=\"blue\">");
    document.write(",</font></div>");
          }
       }
    }
    function initRain() {
    a = 6;
    r[i] = 1;
    sn = Math.sin(a);
    cs = Math.cos(a);
    cx[i] = Math.random() * doc_width + 1;
    cy[i] = Math.random() * doc_height + 1;
    x[i] = r[i] * sn + cx[i];
    y[i] = cy[i];
    }
    function makeRain() {
    r[i] = 1;
    cx[i] = Math.random() * doc_width + 1;
    cy[i] = 1;
    x[i] = r[i] * sn + cx[i];
    y[i] = r[i] * cs + cy[i];
    }
    function updateRain() {
    r[i] += s;
    x[i] = r[i] * sn + cx[i];
    y[i] = r[i] * cs + cy[i];
    }
    function raindropNS() {
    for (i = 0; i < no; ++ i) {
    updateRain();
    if ((x[i] <= 1) || (x[i] >= (doc_width - 20)) || (y[i] >= (doc_height - 20))) {
    makeRain();
    doc_width = self.innerWidth;
    doc_height = self.innerHeight;
    }
    document.layers["dot"+i].top = y[i];
    document.layers["dot"+i].left = x[i];
    }
    setTimeout("raindropNS()", speed);
    }
    function raindropIE() {
    for (i = 0; i < no; ++ i) {
    updateRain();
    if ((x[i] <= 1) || (x[i] >= (doc_width - 20)) || (y[i] >= (doc_height - 20))) {
    makeRain();
    doc_width = document.body.clientWidth;
    doc_height = document.body.clientHeight;
    }
    document.all["dot"+i].style.pixelTop = y[i];
    document.all["dot"+i].style.pixelLeft = x[i];
    }
    setTimeout("raindropIE()", speed);
    }
    if (ns4up) {
    raindropNS();
    }
    else
    if (ie4up) {
    raindropIE();
    }
    //  End -->
    </script>
    </body>
    <font face="Tahoma"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></font>

    Tekst qe ndjek Mousin:
    Kodi:
    
    
    <!-- SUMMARY BRIEF
    
    	This DHTML script will make a text message follow
    	your cursor around the screen. You can change the
    	message to say whatever you want.
    
    	You can change the font face, color and size in
    	the .trailersytle tag below. You can change the message
    	in the javascript below that. Just look for the 
    	comment that says "Insert your personal message below."
    
    -->
    
    
    
    
    
    <style>
    .trailerstyle {
    	position: absolute;
    	visibility: visible;
    	top: -50px;
    	font-size: 12px;
    	font-family: Arial,Helvetica,Verdana;
          	font-weight: bold;
    	color: #000000;
    }
    </style>
    
    <script>
    <!--
    
    var x,y
    var step=20
    var flag=0
    
    // Insert your personal message below.
    // Important: Do NOT remove the space at the end of the sentence!!!
    
    var message=" www.javascriptfreecode.com "
    message=message.split("")
    
    var xpos=new Array()
    for (i=0;i<=message.length-1;i++) {
    	xpos[i]=-50
    }
    
    var ypos=new Array()
    for (i=0;i<=message.length-1;i++) {
    	ypos[i]=-50
    }
    
    function handlerMM(e){
    	x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX
    	y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY
    	flag=1
    }
    
    function mousetrailer() {
    	if (flag==1 && document.all) {
        	for (i=message.length-1; i>=1; i--) {
       			xpos[i]=xpos[i-1]+step
    			ypos[i]=ypos[i-1]
        	}
    		xpos[0]=x+step
    		ypos[0]=y
    	
    		for (i=0; i<message.length-1; i++) {
        		var thisspan = eval("span"+(i)+".style")
        		thisspan.posLeft=xpos[i]
    			thisspan.posTop=ypos[i]
        	}
    	}
    	
    	else if (flag==1 && document.layers) {
        	for (i=message.length-1; i>=1; i--) {
       			xpos[i]=xpos[i-1]+step
    			ypos[i]=ypos[i-1]
        	}
    		xpos[0]=x+step
    		ypos[0]=y
    	
    		for (i=0; i<message.length-1; i++) {
        		var thisspan = eval("document.span"+i)
        		thisspan.left=xpos[i]
    			thisspan.top=ypos[i]
        	}
    	}
    		var timer=setTimeout("mousetrailer()",30)
    }
    
    //-->
    </script>
    
    
    
    
    
    <script>
    <!--
    
    for (i=0;i<=message.length-1;i++) {
        document.write("<span id='span"+i+"' class='trailerstyle'>")
    	document.write(message[i])
        document.write("</span>")
    }
    
    if (document.layers){
    	document.captureEvents(Event.MOUSEMOVE);
    }
    document.onmousemove = handlerMM;
    
    //-->
    </script>
    
    
    
    
    
    
    <body onLoad="mousetrailer()" style="width:100%;overflow-x:hidden;overflow-y:scroll">
    
    
    
    <font face="Tahoma"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></font>

+ Pėrgjigju tek Diskutimi

Tema tė ngjashme

  1. Si tė mbroni veten nga rreziku kritik nė 'JavaScript' tė Firefox 3.5
    Nga Kliton nė forum Guida, Kėshilla dhe truke
    Pėrgjigje: 1
    Postimi i Fundit: 10-11-2009, 01:01 PM
  2. JavaScript
    Nga Gend nė forum Guida, Kėshilla dhe truke
    Pėrgjigje: 0
    Postimi i Fundit: 30-06-2008, 06:18 PM