Last active
October 9, 2018 15:48
-
-
Save zinoojs/285430e82aab1370d4f5efe5f9ea2cda to your computer and use it in GitHub Desktop.
Typing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var arr =[]; | |
arr[1] = 5; | |
arr[0]=arr.length; | |
arr[2]=arr.length; | |
console.log(arr[0]+arr[2] % arr[1]); | |
ans=>4 | |
var arr = [4,3,2,5]; | |
for(var i = 1; i<3; i++){ | |
arr[i]=arr[i-1] + arr[i+1] | |
} | |
console.log(arr); | |
ans => 4,6,11,5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="wrap"> | |
<h1>Todo List <span>0</span> </h1> | |
<h1 class="dad">checked List <span>0</span></h1> | |
<ul id="todo"></ul> | |
<ul id="done"></ul> | |
<div id="new"> | |
<input type="text"><button>+</button> | |
</div> | |
</div> | |
<script src="jquery.js"></script> | |
<script> | |
$('#new button').click(function(){ | |
var text = $('#new input').val(); | |
if(!text) return false; | |
var checkbox = $('<input>', { type: 'checkbox'}).click(function(){ | |
if( $(this).is(':checked')){ | |
$(this).parent().appendTo('#done'); | |
}else{ | |
$(this).parent().appendTo('#todo'); | |
} | |
$('h1 span').html($('#todo li').length); | |
$('.dad span').html($('#done li').length); | |
}) | |
var del = $('<a>', { href: '#'}).html('×').click(function(){ | |
$(this).parent().remove(); | |
$('h1 span').html($('#todo li').length); | |
$('.dad span').html($('#done li').length); | |
}) | |
var li = $('<li>').append(text).append(del).prepend(checkbox); | |
$('#todo').append(li); | |
$('div input').val('').focus(); | |
$('h1 span').html($('#todo li').length); | |
$('.dad span').html($('#done li').length); | |
}) | |
$('#new input').keydown(function(e){ | |
if(e.which == 13){ | |
$('#new button').click(); | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="abc"></div> | |
<script> | |
var text = "Varietyရဲ႕အဆိုအရမင္းသားTomHardyပါဝင္သ႐ုပ္ေဆာင္ထားတဲ့Marvelဟီး႐ိုး႐ုပ္ရွင္ 'Venom' က ေျမာက္အေမရိက ႐ုံဝင္ေငြ စာရင္းမွာ ပထမဆုံး ႐ုံတင္တဲ့ သီတင္းပတ္ကုန္ပိုင္းအတြက္ ဝင္ေငြ ေဒၚလာ သန္း ၈၀ ရရွိခဲ့ၿပီး ကမာၻတဝန္းမွာေတာ့ ႐ုံဝင္ေငြ ေဒၚလာ ၁၂၅ ဒႆမ ၂ သန္းရရွိခဲ့တယ္လို႔ဆိုပါတယ္။တပ္မေတာ္က ႏိုင္ငံေရးတြင္ ပါဝင္ပတ္သက္သည္ကို ျမန္မာႏိုင္ငံတြင္ လူတိုင္းနီးပါးက ေက်နပ္ႏွစ္သက္ျခင္းမရွိ ဟု ေျပာႏိုင္ပါသည္။ သို႔ေသာ္ ရခိုင္ေျမာက္ပိုင္းအေရးတြင္ ျမန္မာျပည္သူအမ်ားစုက တပ္မေတာ္ႏွင့္အတူ ရပ္တည္ၾကသည့္အတြက္ တပ္မေတာ္ကို ႏိုင္ငံေရးမွ ဖယ္ထုတ္ရန္ ႐ိုဟင္ဂ်ာေခၚ ဘဂၤါလီအေရးကို အသုံးခ်ျခင္းက ဆန႔္က်င္ဘက္ ရလဒ္ ထြက္ေပၚလာလိမ့္မည္ဟု NLD ေျပာေရး ဆိုခြင့္ရွိသူက ေျပာသည္။"; | |
var oneText = text.split(''); | |
var loopTime; | |
function loper(){ | |
if(oneText.length > 0){ | |
document.getElementById('abc').innerHTML += oneText.shift(); | |
}else{ | |
clearTimeout(loopTime); | |
} | |
loopTime = setTimeout("loper()", 100); | |
} | |
loper(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment