Για σήμερα σας έχω ένα απλό, αλλά παρα πολύ χρήσιμο widget. Είναι ένα ψηφιακό κομπιουτεράκι. Ναι από αυτό που κάνουμε αριθμητικές πράξεις.
Αυτό το widget πρέπει να το έχει κάθε blog που ασχολείται με:
Στοίχημα, Χρηματιστήριο-Οικονομία, Μαθηματικά-Φυσικοχημείες-Τεχνολογία και όποιο άλλο blog που ασχολείται με αριθμούς. Γενικώς είναι ένα πολύ χρήσιμο εργαλείο.
Μάλιστα σας έχω δύο τέτοια widgetάκια για να διαλέξετε ποιο σας αρέσει περισσότερο.
Η προσθήκη του είναι απλή, σαν οποιοδήποτε άλλο widget.
(σχεδίαση>στοιχεία σελίδας>προσθήκη gadget>HTML-JAVASCRIPT)
Widget 1:
Κωδικός:
<style type="text;css">
.calcBtn
{
font-weight : bold/
width: 32px;
height: 32px;
}
</style>
<script language="JavaScript">
function Calculator_OnClick(keyStr)
{
var resultsField = document.calculator.calcResults;
switch (keyStr)
{
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "0":
case ".":
if ((this.lastOp==this.opClear) || (this.lastOp==this.opOperator))
{
resultsField.value = keyStr;
}
else
{
// ignore extra decimals
if ((keyStr!=".") || (resultsField.value.indexOf(".")<0))
{
resultsField.value += keyStr;
}
}
this.lastOp = this.opNumber;
break;
case "*":
case "/":
case "+":
case "-":
if (this.lastOp==this.opNumber)
this.Calc();
this.evalStr += resultsField.value + keyStr;
this.lastOp = this.opOperator;
break;
case "=":
this.Calc();
this.lastOp = this.opClear;
break;
case "c":
resultsField.value = "0";
this.lastOp = this.opClear;
break;
default:
alert("'" + keyStr + "' not recognized.");
}
}
function Calculator_Calc()
{
var resultsField = document.calculator.calcResults;
//alert("eval:"+this.evalStr+resultsField.value);
resultsField.value = eval(this.evalStr+resultsField.value);
this.evalStr = "";
}
function Calculator()
{
this.evalStr = "";
this.opNumber = 0;
this.opOperator = 1;
this.opClear = 2;
this.lastOp = this.opClear;
this.OnClick = Calculator_OnClick;
this.Calc = Calculator_Calc;
}
gCalculator = new Calculator();
</script>
<form name="calculator">
<table border="2" cellpadding="4" cellspacing="0" bordercolor="#000000">
<tr>
<td>
<table border="0" cellpadding="2" cellspacing="0" width="100%">
<tr>
<td colspan="4">
<input type="text" name="calcResults" value="0" size="20" style="text-align: right" /></td>
</tr>
<tr>
<td><input class="calcBtn" type="button" value=" C " name="calclear" onclick="gCalculator.OnClick('c')" /></td>
<td></td>
<td> </td>
<td><input class="calcBtn" type="button" value=" = " name="calequal" onclick="gCalculator.OnClick('=')" /></td>
</tr>
<tr>
<td><input class="calcBtn" type="button" value=" 7 " name="cal7" onclick="gCalculator.OnClick('7')" ondblclick="gCalculator.OnClick('7')" /></td>
<td><input class="calcBtn" type="button" value=" 8 " name="cal8" onclick="gCalculator.OnClick('8')" ondblclick="gCalculator.OnClick('8')" /> </td>
<td><input class="calcBtn" type="button" value=" 9 " name="cal9" onclick="gCalculator.OnClick('9')" ondblclick="gCalculator.OnClick('9')" /> </td>
<td><input class="calcBtn" type="button" value=" / " name="caldiv" onclick="gCalculator.OnClick('/')" /></td>
</tr>
<tr>
<td><input class="calcBtn" type="button" value=" 4 " name="cal4" onclick="gCalculator.OnClick('4')" ondblclick="gCalculator.OnClick('4')" /> </td>
<td><input class="calcBtn" type="button" value=" 5 " name="cal5" onclick="gCalculator.OnClick('5')" ondblclick="gCalculator.OnClick('5')" /> </td>
<td><input class="calcBtn" type="button" value=" 6 " name="cal6" onclick="gCalculator.OnClick('6')" ondblclick="gCalculator.OnClick('6')" /> </td>
<td><input class="calcBtn" type="button" value=" * " name="calmul" onclick="gCalculator.OnClick('*')" /></td>
</tr>
<tr>
<td><input class="calcBtn" type="button" value=" 1 " name="cal1" onclick="gCalculator.OnClick('1')" ondblclick="gCalculator.OnClick('1')" /> </td>
<td><input class="calcBtn" type="button" value=" 2 " name="cal2" onclick="gCalculator.OnClick('2')" ondblclick="gCalculator.OnClick('2')" /> </td>
<td><input class="calcBtn" type="button" value=" 3 " name="cal3" onclick="gCalculator.OnClick('3')" ondblclick="gCalculator.OnClick('3')" /> </td>
<td><input class="calcBtn" type="button" value=" + " name="calplus" onclick="gCalculator.OnClick('+')" /></td>
</tr>
<tr>
<td> </td>
<td><input class="calcBtn" type="button" value=" 0 " name="cal0" onclick="gCalculator.OnClick('0')" ondblclick="gCalculator.OnClick('0')" /> </td>
<td><input class="calcBtn" type="button" value=" . " name="caldec" onclick="gCalculator.OnClick('.')" /></td>
<td><input class="calcBtn" type="button" value=" - " name="calminus" onclick="gCalculator.OnClick('-')" /></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<font face="Tahoma"><a target="_blank" href="http://johnpatrablog.blogspot.com/2010/07/online-blog-html-calculator-for-your.html"><span style="font-size: 6pt; text-decoration: none">Johnpatrablog</span></a></font>
Widget 2:
Κωδικός:
<!-- This Script is from www.htmlfreecodes.com, Coded by: Krishna Eydat-->
<center>
<form name="Keypad" action="">
<table>
<b>
<table border=2 width=50 height=60 cellpadding=1 cellspacing=5>
<tr>
<td colspan=3 align=middle>
<input name="ReadOut" type="Text" size="24" value="0" width="100%" />
</td>
<td>
<input name="btnClear" type="Button" value=" C " onclick="Clear()" />
</td>
<td><input name="btnClearEntry" type="Button" value=" CE " onclick="ClearEntry()" />
</td>
</tr>
<tr>
<td>
<input name="btnSeven" type="Button" value=" 7 " onclick="NumPressed(7)" />
</td>
<td>
<input name="btnEight" type="Button" value=" 8 " onclick="NumPressed(8)" />
</td>
<td>
<input name="btnNine" type="Button" value=" 9 " onclick="NumPressed(9)" />
</td>
<td>
</td>
<td>
<input name="btnNeg" type="Button" value=" +/- " onclick="Neg()" />
</td>
<td>
<input name="btnPercent" type="Button" value=" % " onclick="Percent()" />
</td>
</tr>
<tr>
<td>
<input name="btnFour" type="Button" value=" 4 " onclick="NumPressed(4)" />
</td>
<td>
<input name="btnFive" type="Button" value=" 5 " onclick="NumPressed(5)" />
</td>
<td>
<input name="btnSix" type="Button" value=" 6 " onclick="NumPressed(6)" />
</td>
<td>
</td>
<td align=middle><input name="btnPlus" type="Button" value=" + " onclick="Operation('+')" />
</td>
<td align=middle><input name="btnMinus" type="Button" value=" - " onclick="Operation('-')" />
</td>
</tr>
<tr>
<td>
<input name="btnOne" type="Button" value=" 1 " onclick="NumPressed(1)" />
</td>
<td>
<input name="btnTwo" type="Button" value=" 2 " onclick="NumPressed(2)" />
</td>
<td>
<input name="btnThree" type="Button" value=" 3 " onclick="NumPressed(3)" />
</td>
<td>
</td>
<td align=middle><input name="btnMultiply" type="Button" value=" * " onclick="Operation('*')" />
</td>
<td align=middle><input name="btnDivide" type="Button" value=" / " onclick="Operation('/')" />
</td>
</tr>
<tr>
<td>
<input name="btnZero" type="Button" value=" 0 " onclick="NumPressed(0)" />
</td>
<td>
<input name="btnDecimal" type="Button" value=" . " onclick="Decimal()" />
</td>
<td colspan=3>
</td>
<td>
<input name="btnEquals" type="Button" value=" = " onclick="Operation('=')" />
</td>
</tr>
</table>
</b></table>
</form>
</center>
<font face="Verdana, Arial, Helvetica" size=2>
<script language="JavaScript">
<!-- Begin
var FKeyPad = document.Keypad;
var Accumulate = 0;
var FlagNewNum = false;
var PendingOp = "";
function NumPressed (Num) {
if (FlagNewNum) {
FKeyPad.ReadOut.value = Num;
FlagNewNum = false;
}
else {
if (FKeyPad.ReadOut.value == "0")
FKeyPad.ReadOut.value = Num;
else
FKeyPad.ReadOut.value += Num;
}
}
function Operation (Op) {
var Readout = FKeyPad.ReadOut.value;
if (FlagNewNum && PendingOp != "=");
else
{
FlagNewNum = true;
if ( '+' == PendingOp )
Accumulate += parseFloat(Readout);
else if ( '-' == PendingOp )
Accumulate -= parseFloat(Readout);
else if ( '/' == PendingOp )
Accumulate /= parseFloat(Readout);
else if ( '*' == PendingOp )
Accumulate *= parseFloat(Readout);
else
Accumulate = parseFloat(Readout);
FKeyPad.ReadOut.value = Accumulate;
PendingOp = Op;
}
}
function Decimal () {
var curReadOut = FKeyPad.ReadOut.value;
if (FlagNewNum) {
curReadOut = "0.";
FlagNewNum = false;
}
else
{
if (curReadOut.indexOf(".") == -1)
curReadOut += ".";
}
FKeyPad.ReadOut.value = curReadOut;
}
function ClearEntry () {
FKeyPad.ReadOut.value = "0";
FlagNewNum = true;
}
function Clear () {
Accumulate = 0;
PendingOp = "";
ClearEntry();
}
function Neg () {
FKeyPad.ReadOut.value = parseFloat(FKeyPad.ReadOut.value) * -1;
}
function Percent () {
FKeyPad.ReadOut.value = (parseFloat(FKeyPad.ReadOut.value) / 100) * parseFloat(Accumulate);
}
// End -->
</script>
<font face="Tahoma"><a target="_blank" href="http://johnpatrablog.blogspot.com/2010/07/online-blog-html-calculator-for-your.html"><span style="font-size: 6pt; text-decoration: none">Johnpatrablog</span></a></font></font>
Κάτω από κάθε widget έχω βάλει έναν σύνδεσμο που οδηγεί εδώ. Σας παρακαλώ μην τον σβήσετε, αλλά αν σας ενοχλεί τόσο δεν μπορώ να σας απαγορέψω να το διαγράψετε. Αλλά πόσο να σας ενοχλήσει? Τον έχω κάνει τόσο μικρό, που σχεδόν δε φαίνεται!
Αποθηκεύστε το widget κι απολαύστε το!
Ελπίζω να σας φανεί χρήσιμο :)
Διαδώστε αυτό το post στο facebook με ένα απλό πάτημα του παρακάτω κουμπιού:
3 comments:
Μπράβο φίλε πολύ καλή δουλειά.. Συνέχισε έτσι!!!
While the product is best for light to moderate smokers, it works well as a standalone product. It’s not as effective at detoxifying the hair of chronic and heavy users. Customers praised the product buildup in a way that gives pleasantly mild baby-shampoo-like fragrance and how hair retained its natural health and shine even after continued use. It's reabsorbed into the blood and broken down very quickly. Finally, there is the saliva drug test, which takes a sample from your oral fluid. Marijuana can enter your saliva through smoking. Visit: https://www.urineworld.com/
Obtain iSaveMoney totally free and begin taking management of your private finance and month-to-month funds planning. iSaveMoney is an effective funds app to trace spending and bills
Budget Planner Expense Tracker MOD APK
Δημοσίευση σχολίου
Παρακαλούμε τους φίλους αναγνώστες:
ΟΧΙ SPAM,
ΟΧΙ GREEKLISH,
ΟΧΙ ΠΡΟΣΒΛΗΤΙΚΑ ΣΧΟΛΙΑ
Παρακαλώ το σχόλιό σας να είναι σχετικό με την παραπάνω ανάρτηση.
Γενικές απορίες μόνο στη σελίδα μας στο facebook.