Hello
  Home Help Search Login Register DMCA Rules  
23 May 2013, 15:43:10
 

Rapidshare Search
Skoci na stranu: 1    Idi na dno strane
Send this topic    Print
Author Topic: JavaScript  (Read 2763 times)
0 Members and 1 Guest are viewing this topic.

Postovani/a
Hvala vam sto ste postali deo nase zajednice...
mozete skidati sve sto zelite bez registracije na nas forum..
« on: 18 October 2009, 15:36:35 »

JavaScript Countdown Timer

This JavaScript displays a countdown timer and alerts the user when the timer reaches zero. It then redirects to another Web page. Particularly useful if you are writing an online test.


Demo: JavaScript Countdown Timer

How to setup

Step 1: Copy & Paste CSS code below in your HEAD section
CSS

Code:
<style type="text/css">
#txt {
  border:none;
  font-family:verdana;
  font-size:16pt;
  font-weight:bold;
  border-right-color:#FFFFFF
}

</style>

Step 2: Copy & Paste JavaScript code below in your HEAD section
JavaScript

Code:
<script language="javascript">
// Created by: Neill Broderick :: http://www.bespoke-software-solutions.co.uk/downloads/downjs.php

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>

Step 3: Copy & Paste HTML code below in your BODY section
HTML

Code:
<form name="cd">
<input id="txt" readonly="true" type="text" value="10:00" border="0" name="disp">
</form>
  • *
  • Zena administratora PiRaT-a!
  • zahvalnica: 86

  • pol: Female
  • Location: Novi Sad
  • Date Registerd:20 May 2009, 14:17:54
  • Posts: 2587
  • Topics: 263
  • Activity/Aktivnost
    0%
  • OS:
    Windows XP Windows XP
  • Browser:
    Opera 9.80 Opera 9.80
    • enferty@hotmail.com
« Last Edit: 18 October 2009, 15:38:08 by enferty » Logged

::postovani, gosti i clanovi... Make RapidBelgrade more strong by donating us. Even donation can make RapidBelgrade better and bigger... You can make donation via PayPal or Payza... ::
Rapidshare Search

« Reply #1 on: 18 October 2009, 15:41:49 »

No RightClick IE Menu

This JavaScript will disable the JavaScript menu right-click of IE Browser.

Demo: No RightClick IE Menu

How to setup

Step 1: Place HTML below in your BODY section
HTML

Code:
<body oncontextmenu=window.event.returnValue=false>
  • *
  • Zena administratora PiRaT-a!
  • zahvalnica: 86

  • pol: Female
  • Location: Novi Sad
  • Date Registerd:20 May 2009, 14:17:54
  • Posts: 2587
  • Topics: 263
  • Activity/Aktivnost
    0%
  • OS:
    Windows XP Windows XP
  • Browser:
    Opera 9.80 Opera 9.80
    • enferty@hotmail.com
Logged

« Reply #2 on: 18 October 2009, 17:55:35 »

Virus Joke

<!-- TWO STEPS TO INSTALL VIRUS:

1. Paste the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->

<!-- STEP ONE: Copy this code into the HEAD of your HTML document -->

<HEAD>

Code:
<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function confirmClose() {       
alert("Error: 107x has occurred.  A virus has begun to infect your hard drive.  Please erase all infected files.")         
if (confirm("Please inform the the hardware vendor of this error."))
alert('The virus has been contained but the browser will shutdown to check for and prevent further internal damages.');
else
alert('The problem has not been fixed, the browser must be shut downtown to prevent further contamination.');
  {             
parent.close();       
   }
}
// End -->
</SCRIPT>

<!-- STEP TWO: Put this code into the BODY of your HTML document -->

<BODY>

Code:
<CENTER>
<FORM>
<input type="button" value ="JavaScript Virus (not really...)" onClick="confirmClose()">
</FORM>
</CENTER>
  • *
  • Zena administratora PiRaT-a!
  • zahvalnica: 86

  • pol: Female
  • Location: Novi Sad
  • Date Registerd:20 May 2009, 14:17:54
  • Posts: 2587
  • Topics: 263
  • Activity/Aktivnost
    0%
  • OS:
    Windows XP Windows XP
  • Browser:
    Opera 9.80 Opera 9.80
    • enferty@hotmail.com
Logged

Skoci na stranu: 1    Idi na vrh strane
Send this topic    Print
 
Skoci na:  


Rapidshare Search



Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC
Page created in 0.05 seconds with 28 queries.

Google visited last this page 09 May 2013, 19:25:53
Theme created by Logo Off