Slide

Carousel

Latest Post

������ ������� �������� ���� 2016 ����� ������ - �� ���� ������ ��� ����� �� ��� ��� �������ɡ ��� ����� ������ ����� �������� ���� �� �����❗ ���� 12 ��� ����� ����� ������ ������� �������� ���� 2016� �� ����� ������� ������ ��� ����� �� ��� ��� ��ɡ ����� ��������� ������ ����� ��� ������ ������� ������ �� ����� ��� ������ �� ��� ������� ������ �� ��������� ������ ��.



�� ������ ����� �� ������� �� ������ ������� ���� ����� ������ �� ������ 👈
������ ������� �������� ���� 2016 ����� ������ - �� ���� ������ ��� ����� �� ��� ��� �������ɡ ��� ����� ������ ����� �������� ���� �� �����❗ ���� 12 ��� ����� ����� ������ ������� �������� ���� 2016� �� ����� ������� ������ ��� ����� �� ��� ��� ��ɡ ����� ��������� ������ ����� ��� ������ ������� ������ �� ����� ��� ������ �� ��� ������� ������ �� ��������� ������ ��.



�� ������ ����� �� ������� �� ������ ������� ���� ����� ������ �� ������ 👈
��� SEOFastBlogger ���� - ���� ��� �� ���� ����� ����� �������� � ���� ������� �����͡ ���� ���� ��ǡ �� ������ ������ (bootstrap) � ���� ���� ������� ���� ���� �������� �� (Arabic) ���� ������� ���� ����� �� ������ �� ��� ����� � ���� ������ ���� ���� ��� ��� ��� �����ȡ ������� ������� � ������� ���� ���. �� ��� �� �� � ������ �ǡ �� �� ����� ����� ���� �������.


������� �����



��� SEOFastBlogger ���� - ���� ��� �� ���� ����� ����� �������� � ���� ������� �����͡ ���� ���� ��ǡ �� ������ ������ (bootstrap) � ���� ���� ������� ���� ���� �������� �� (Arabic) ���� ������� ���� ����� �� ������ �� ��� ����� � ���� ������ ���� ���� ��� ��� ��� �����ȡ ������� ������� � ������� ���� ���. �� ��� �� �� � ������ �ǡ �� �� ����� ����� ���� �������.


������� �����



��� Invento ���� - ��� ��� ������ ������ �������� ������ ������ʡ ����� ����� ��� ��� ����� ��� ���� ������. ����� �� ���� ��� ������ ������� ������ �� �� ����� ��� ���� ��� �� ��� �� ���� ���� ������ ����� ������ ��� ������ ��� ����� �� ����� ��� ���� ������� �������� ����� ������ ����� �� ���� �������� ��� ���� ��������

������� �����



��� Invento ���� - ��� ��� ������ ������ �������� ������ ������ʡ ����� ����� ��� ��� ����� ��� ���� ������. ����� �� ���� ��� ������ ������� ������ �� �� ����� ��� ���� ��� �� ��� �� ���� ���� ������ ����� ������ ��� ������ ��� ����� �� ����� ��� ���� ������� �������� ����� ������ ����� �� ���� �������� ��� ���� ��������

������� �����



��� ���� ����� �� ���� ���� ���� �������� �� ������� ����� ������� ������� ��� ����� ��� ���� �������� ���� �� ���� ���� ����� ������� ��� ���� Github ������ ������� ��������.

�������� ����� ������� ��� ���� �������� ����� CssJavascript ��� ���� ����� �� ����� ����� ���� ����� ��� ����� ������ ����� ���� ����� ����� ���� �����ݡ ���� �������� ���� ���� ���� ��� �������� ������ ��� ������� �������� ��� ���� Github� ��� ��� ������ ��� ������� ������� ��� Google Drive. ��� �� ���� ����� ������� ���� ���� �� ���� Github

���� Github �� ���� ������� ������� ������ ��������� ������ ��������� ����� ������ǡ ���� ������ ��� ������ ������� �������� �������� ������
���� ���� ��� 2008 ���� �������� ����� Git ���� 2009� ��� ���� �� ���� ������� �������� ������� �������� ������.

�� ������ ���� �� ����� ������ ����� ������ ����� ���� ��� �� ���� ����� ������� �� ��� ������ ��� �� ���� ����� ����� ������

��� ��� ���� ����� Github
1. �� ������� ������ https://github.com/
2. ���� ��� Sign up �� ���� �������:
Username - ��� ������
Email Address � ������ ����������
Password - ��������� (��� �� ����� �����)
3. ���� ��� Finish sign up
* ������ ���� �� ������ ������ ��� ����� ��� �������� ������ �������

��� ������� �������
�� ��� ������ ��� ���� ������ ���� ������� ���� ���� ������� ��
1. ���� ��� New Repository ��� �� ������ �����



2. �� �� ���� Repository name ��� ����� �� �� ��� ���� ���� ������ ��� �� ������




3. ������ ������ ����� �� ���� ��� New file
4. �� ��� ����� ����� �� .js �� .css �� ������ 1 ������ �� ������ 2



5. ���� ��� Commit new file

������ ��� ���� �����
��� �� ������� ������� ������ ������ ����� ����� �� ��� ������ ������� ����� ���� ����� �����
1. �� ��� ����� ���� ��� ���� ������ ������ ����� ������



2. ��� �� ���� ������ ���� ���� ������ https://rawgit.com
3. �� ������ ������� �� ������ ������ ������ �� ������ ���� ���� �� ������ ������ (Use this URL for development)



4. �����ǡ �� ���� ������ �� ����� ������� / ������� ����:
<script src='https://cdn.rawgit.com/iHussam/ar1web/master/tajriba.js' type='text/javascript'></script>
����� ���� �� ����� ������ ����� �������� ������� ��� Github� ��� ���� ����� �� ��� ������������ ���� ���
��� ���� ����� �� ���� ���� ���� �������� �� ������� ����� ������� ������� ��� ����� ��� ���� �������� ���� �� ���� ���� ����� ������� ��� ���� Github ������ ������� ��������.

�������� ����� ������� ��� ���� �������� ����� CssJavascript ��� ���� ����� �� ����� ����� ���� ����� ��� ����� ������ ����� ���� ����� ����� ���� �����ݡ ���� �������� ���� ���� ���� ��� �������� ������ ��� ������� �������� ��� ���� Github� ��� ��� ������ ��� ������� ������� ��� Google Drive. ��� �� ���� ����� ������� ���� ���� �� ���� Github

���� Github �� ���� ������� ������� ������ ��������� ������ ��������� ����� ������ǡ ���� ������ ��� ������ ������� �������� �������� ������
���� ���� ��� 2008 ���� �������� ����� Git ���� 2009� ��� ���� �� ���� ������� �������� ������� �������� ������.

�� ������ ���� �� ����� ������ ����� ������ ����� ���� ��� �� ���� ����� ������� �� ��� ������ ��� �� ���� ����� ����� ������

��� ��� ���� ����� Github
1. �� ������� ������ https://github.com/
2. ���� ��� Sign up �� ���� �������:
Username - ��� ������
Email Address � ������ ����������
Password - ��������� (��� �� ����� �����)
3. ���� ��� Finish sign up
* ������ ���� �� ������ ������ ��� ����� ��� �������� ������ �������

��� ������� �������
�� ��� ������ ��� ���� ������ ���� ������� ���� ���� ������� ��
1. ���� ��� New Repository ��� �� ������ �����



2. �� �� ���� Repository name ��� ����� �� �� ��� ���� ���� ������ ��� �� ������




3. ������ ������ ����� �� ���� ��� New file
4. �� ��� ����� ����� �� .js �� .css �� ������ 1 ������ �� ������ 2



5. ���� ��� Commit new file

������ ��� ���� �����
��� �� ������� ������� ������ ������ ����� ����� �� ��� ������ ������� ����� ���� ����� �����
1. �� ��� ����� ���� ��� ���� ������ ������ ����� ������



2. ��� �� ���� ������ ���� ���� ������ https://rawgit.com
3. �� ������ ������� �� ������ ������ ������ �� ������ ���� ���� �� ������ ������ (Use this URL for development)



4. �����ǡ �� ���� ������ �� ����� ������� / ������� ����:
<script src='https://cdn.rawgit.com/iHussam/ar1web/master/tajriba.js' type='text/javascript'></script>
����� ���� �� ����� ������ ����� �������� ������� ��� Github� ��� ���� ����� �� ��� ������������ ���� ���
�� ����� - �� �� ���� �� ���� ���� ����� ��� ����� ��������� ������ ���� �������.. ����� ��� ���� ���� ���� ��� ������� ��� ���� ��� �� ���� �������� 👌



�� ����� - �� �� ���� �� ���� ���� ����� ��� ����� ��������� ������ ���� �������.. ����� ��� ���� ���� ���� ��� ������� ��� ���� ��� �� ���� �������� 👌



����� ����� ����� ������� ������� - �� ����� ��� ������ ��� ������� ������� ���� ������ �� ��� ������� �������� ������ ���������� ������� ������ �� � ������� ���� ����� �� ����� ��� ������ ���� ���� ������� � ����� ��� ��� ���� ��� ������ �� ������ ������� " ��������� " � ��� ���� �� ����� ������� ������ �� � ��� ��� ���� ��� ����� ������� ������� �� ���� �� ������� �������

���� ������� �� ����� ������� �� ������� ��������� ��� ��� ����� ����� ������� ������ ����� ����� ���� ��� ������ �� ����� ����� ������� ������ V1 ���� ����� ����� ���� ��� ������ V2
��� ����� �������
1. ���� ��� ������� ��� ������ ����� ����� �� ������ ������� " ��������� "




2. �� ���� ������ ���� �� ]]></b:skin> �� �� ����� ������ ����
#ContactForm1 {display:none;}
���� ��� ��� �������
3. ����� ��� ��� ������� ����� ��� ���� ����� �� �� ������� Contact (����� ������ ������� ��� �� ���� ������)
4. ����� �� ��� ����� ��� HTML ��� ����� ������
<form name="contact-form">
����� ������
<input id="ContactForm1_contact-form-name" name="name" size="30" type="text" value="" />

������ ���������� <span style="color: #f56954; font-size: x-small; font-weight: bold;">���</span>
<input id="ContactForm1_contact-form-email" name="email" size="30" type="text" value="" />

������� <span style="color: #f56954; font-size: x-small; font-weight: bold;">���</span>
<textarea cols="25" id="ContactForm1_contact-form-email-message" name="email-message" rows="5"></textarea>
<input id="ContactForm1_contact-form-submit" type="button" value="�����" />
<div style="max-width: 222px; text-align: center; width: 100%;">
<div id="ContactForm1_contact-form-error-message">
</div>
<div id="ContactForm1_contact-form-success-message">
</div>
</div>
</form>
<style scoped="" type="text/css">
#comments {display:none;}
#ContactForm1_contact-form-name, #ContactForm1_contact-form-email{
height:auto;margin:5px auto;padding:10px;background:#fafafa;color:#444;width: 100%;border:1px solid #ccc;border-radius:3px;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;transition:all 0.5s ease-out;}
#ContactForm1_contact-form-email-message{width:100%;height:175px;margin:5px 0;padding:10px 0;background:#fafafa;color:#444;border:1px solid #ccc;border-radius:3px;resize:none;transition:all 0.5s ease-out;}
#ContactForm1_contact-form-name:focus, #ContactForm1_contact-form-email:focus, #ContactForm1_contact-form-email-message:focus{outline:none;background:#fff;color:#444;border-color:rgba(81,203,238,1);box-shadow:0 0 5px rgba(81,203,238,0.7);}
#ContactForm1_contact-form-submit{float:left;background:#0099CC;color:#fff;margin:10px auto;vertical-align:middle;cursor:pointer;padding:10px 18px!important;font-weight:700;font-size:14px;text-align:center;text-transform:uppercase;letter-spacing:.5px;border-radius:4px;border:0;transition:all .8s ease}
#ContactForm1_contact-form-submit:hover {background:#2A2B2B;color:#fff;}
#ContactForm1_contact-form-error-message, #ContactForm1_contact-form-success-message{width:100%;margin-top:35px;}
.contact-form-error-message-with-border {background:#f6f6f6;border:none;box-shadow:none;color:#444;padding:5px 0;}
.contact-form-success-message {background:#4fc3f7;border:none;box-shadow:none;color:#fff;}
img.contact-form-cross {line-height:40px;margin-left:5px;}
.post-body input {width:initial;}
@media only screen and (max-width:640px){
#ContactForm1_contact-form-name, #ContactForm1_contact-form-email,#ContactForm1_contact-form-submit{width:100%;}}
</style>
5. ���� ���� ��������� ��� ������ ��������� �������



6. ���� ��� ���  ��� ���� ������ ���� �������
��� ������ ����� ������� ��� ����� ��������� �������
����� ����� ����� ������� ������� - �� ����� ��� ������ ��� ������� ������� ���� ������ �� ��� ������� �������� ������ ���������� ������� ������ �� � ������� ���� ����� �� ����� ��� ������ ���� ���� ������� � ����� ��� ��� ���� ��� ������ �� ������ ������� " ��������� " � ��� ���� �� ����� ������� ������ �� � ��� ��� ���� ��� ����� ������� ������� �� ���� �� ������� �������

���� ������� �� ����� ������� �� ������� ��������� ��� ��� ����� ����� ������� ������ ����� ����� ���� ��� ������ �� ����� ����� ������� ������ V1 ���� ����� ����� ���� ��� ������ V2
��� ����� �������
1. ���� ��� ������� ��� ������ ����� ����� �� ������ ������� " ��������� "




2. �� ���� ������ ���� �� ]]></b:skin> �� �� ����� ������ ����
#ContactForm1 {display:none;}
���� ��� ��� �������
3. ����� ��� ��� ������� ����� ��� ���� ����� �� �� ������� Contact (����� ������ ������� ��� �� ���� ������)
4. ����� �� ��� ����� ��� HTML ��� ����� ������
<form name="contact-form">
����� ������
<input id="ContactForm1_contact-form-name" name="name" size="30" type="text" value="" />

������ ���������� <span style="color: #f56954; font-size: x-small; font-weight: bold;">���</span>
<input id="ContactForm1_contact-form-email" name="email" size="30" type="text" value="" />

������� <span style="color: #f56954; font-size: x-small; font-weight: bold;">���</span>
<textarea cols="25" id="ContactForm1_contact-form-email-message" name="email-message" rows="5"></textarea>
<input id="ContactForm1_contact-form-submit" type="button" value="�����" />
<div style="max-width: 222px; text-align: center; width: 100%;">
<div id="ContactForm1_contact-form-error-message">
</div>
<div id="ContactForm1_contact-form-success-message">
</div>
</div>
</form>
<style scoped="" type="text/css">
#comments {display:none;}
#ContactForm1_contact-form-name, #ContactForm1_contact-form-email{
height:auto;margin:5px auto;padding:10px;background:#fafafa;color:#444;width: 100%;border:1px solid #ccc;border-radius:3px;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;transition:all 0.5s ease-out;}
#ContactForm1_contact-form-email-message{width:100%;height:175px;margin:5px 0;padding:10px 0;background:#fafafa;color:#444;border:1px solid #ccc;border-radius:3px;resize:none;transition:all 0.5s ease-out;}
#ContactForm1_contact-form-name:focus, #ContactForm1_contact-form-email:focus, #ContactForm1_contact-form-email-message:focus{outline:none;background:#fff;color:#444;border-color:rgba(81,203,238,1);box-shadow:0 0 5px rgba(81,203,238,0.7);}
#ContactForm1_contact-form-submit{float:left;background:#0099CC;color:#fff;margin:10px auto;vertical-align:middle;cursor:pointer;padding:10px 18px!important;font-weight:700;font-size:14px;text-align:center;text-transform:uppercase;letter-spacing:.5px;border-radius:4px;border:0;transition:all .8s ease}
#ContactForm1_contact-form-submit:hover {background:#2A2B2B;color:#fff;}
#ContactForm1_contact-form-error-message, #ContactForm1_contact-form-success-message{width:100%;margin-top:35px;}
.contact-form-error-message-with-border {background:#f6f6f6;border:none;box-shadow:none;color:#444;padding:5px 0;}
.contact-form-success-message {background:#4fc3f7;border:none;box-shadow:none;color:#fff;}
img.contact-form-cross {line-height:40px;margin-left:5px;}
.post-body input {width:initial;}
@media only screen and (max-width:640px){
#ContactForm1_contact-form-name, #ContactForm1_contact-form-email,#ContactForm1_contact-form-submit{width:100%;}}
</style>
5. ���� ���� ��������� ��� ������ ��������� �������



6. ���� ��� ���  ��� ���� ������ ���� �������
��� ������ ����� ������� ��� ����� ��������� �������
����� ��������� ������� �� �� ���� ����� ������ ����� ��� ����� ����� �������� ��� ��� ����� ������� ������ ����� ��� ����� ��� ���� ������ 😜 �ǡ ������ ������� �������� ������� ��� ������� �������� (Cursor) ��� ������� ���� ������ ���� ����� ��� ������ ����� ������ �� ������ ���� ������� ���� ������� (Scroll bar) ���� ����� ������ �� ������ ����� ��� ����� ��� ��������.
��� �� ���� ��� ������� �� ������� ����
��� ����� �������
1. ���� ��� ���� >> �����
2. ���� ����� ������ ���� ��� </body>
 <script type='text/javascript'>
//<![CDATA[
function TouchScroll() {
var instance = this;
var Event = {
CHANGE: 'change',
COMPLETE: 'complete',
ERROR: 'error',
TOUCH_START: 'touchstart',
TOUCH_MOVE: 'touchmove',
TOUCH_END: 'touchend',
MOUSE_DOWN: 'mousedown',
MOUSE_MOVE: 'mousemove',
MOUSE_UP: 'mouseup'
};
this.options = {
'element': null
};
var drag = false;
var startevent = {};
var startpercentage = {};
var axis = 'y';
var target;
this.load = function(data) {
for (var item in data) {this.options[item] = data[item];}
addListeners();
setupAnimation();
}
function setupAnimation() {
window.requestAnimFrame = (function() {
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function(callback, element) {window.setTimeout(callback, 1000 / 60);};
})();
}
function addListeners() {
if (instance.options.element.addEventListener) {
instance.options.element.addEventListener(Event.MOUSE_DOWN, onTouchStart, false);
instance.options.element.addEventListener(Event.MOUSE_MOVE, onTouchMove, false);
instance.options.element.addEventListener(Event.MOUSE_UP, onTouchEnd, false);
instance.options.element.addEventListener(Event.TOUCH_START, onTouchStart, false);
instance.options.element.addEventListener(Event.TOUCH_MOVE, onTouchMove, false);
instance.options.element.addEventListener(Event.TOUCH_END, onTouchEnd, false);
}
}
function onTouchStart(e) {
drag = true;
target = instance.options.element || e.target;
startevent = e;
startpercentage = {x: (e.x/window.innerWidth)*100, y: (e.y/window.innerHeight)*100}
//console.log('onTouchStart', e, target);
e.preventDefault();
}
function onTouchMove(e) {
if (drag == true) {
var diffx = (startevent.pageX-e.pageX);
var diffy = (startevent.pageY-e.pageY);
target.scrollLeft += diffx;
target.scrollTop += diffy;

if (Math.abs(diffx) > 60) {axis = 'x';}
else if (Math.abs(diffy) > 100) {axis = 'y';}

//console.log('onTouchMove', target, diffx, diffy);
e.preventDefault();
}
}
function onTouchEnd(e) {
drag = false;

var endpercentage = {x: (e.x/window.innerWidth)*100, y: (e.y/window.innerHeight)*100}
var diffpercentagex = -(endpercentage.x-startpercentage.x);
var diffpercentagey = -(endpercentage.y-startpercentage.y);

var diffx = (window.innerWidth/100)*diffpercentagex;
var diffy = (window.innerHeight/100)*diffpercentagey;

//console.log('onTouchEnd', e, diffpercentagex, diffpercentagey);

//animate();

scrollAxis(diffx*1.5, diffy*1.5, axis);

e.preventDefault();
}
function animate() {
requestAnimFrame(animate);
console.log('animate');
}
function scrollAxis(diffx, diffy, axis) {
var x = target.scrollLeft;
var y = target.scrollTop;
var start = y;
var stop = start+diffy;
if (axis == 'x') {
start = x;
stop = start+diffx;
}

var distance = stop > start ? stop - start : start - stop;
if (distance < 50) {
if (axis == 'x') { instance.updatePosition(stop, y); }
else { instance.updatePosition(x, stop); }
return;
}
var speedY = Math.round(distance);
if (speedY >= 20) speedY = 20;
var step = Math.round(distance / 30);
var leapY = stop > start ? start + step : start - step;
var timer = 0;
//console.log(axis, distance, target, start, stop);
if (stop > start) {
for ( var i=start; i<stop; i+=step ) {
if (axis == 'x') { setTimeout("touchscroll.updatePosition("+leapY+", 0)", timer*speedY); }
else { setTimeout("touchscroll.updatePosition(0, "+leapY+")", timer*speedY); }
leapY += step;
if (leapY > stop) leapY = stop;
timer++;
}
return;
}
for ( var i=start; i>stop; i-=step ) {
if (axis == 'x') { setTimeout("touchscroll.updatePosition("+leapY+", 0)", timer*speedY); }
else { setTimeout("touchscroll.updatePosition(0, "+leapY+")", timer*speedY); }
leapY -= step;
if (leapY < stop) leapY = stop;
timer++;
}
}
this.updatePosition = function(x, y) {
//console.log('window.scrollTo', x, y);
target.scrollLeft = x;
target.scrollTop = y;
}
}
TouchScroll.prototype = new TouchScroll();

var touchscroll = new TouchScroll();
touchscroll.load({
'element': document.getElementsByTagName('body')[0]
});
//]]>
</script>
����� ��������� ������� �� �� ���� ����� ������ ����� ��� ����� ����� �������� ��� ��� ����� ������� ������ ����� ��� ����� ��� ���� ������ 😜 �ǡ ������ ������� �������� ������� ��� ������� �������� (Cursor) ��� ������� ���� ������ ���� ����� ��� ������ ����� ������ �� ������ ���� ������� ���� ������� (Scroll bar) ���� ����� ������ �� ������ ����� ��� ����� ��� ��������.
��� �� ���� ��� ������� �� ������� ����
��� ����� �������
1. ���� ��� ���� >> �����
2. ���� ����� ������ ���� ��� </body>
 <script type='text/javascript'>
//<![CDATA[
function TouchScroll() {
var instance = this;
var Event = {
CHANGE: 'change',
COMPLETE: 'complete',
ERROR: 'error',
TOUCH_START: 'touchstart',
TOUCH_MOVE: 'touchmove',
TOUCH_END: 'touchend',
MOUSE_DOWN: 'mousedown',
MOUSE_MOVE: 'mousemove',
MOUSE_UP: 'mouseup'
};
this.options = {
'element': null
};
var drag = false;
var startevent = {};
var startpercentage = {};
var axis = 'y';
var target;
this.load = function(data) {
for (var item in data) {this.options[item] = data[item];}
addListeners();
setupAnimation();
}
function setupAnimation() {
window.requestAnimFrame = (function() {
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function(callback, element) {window.setTimeout(callback, 1000 / 60);};
})();
}
function addListeners() {
if (instance.options.element.addEventListener) {
instance.options.element.addEventListener(Event.MOUSE_DOWN, onTouchStart, false);
instance.options.element.addEventListener(Event.MOUSE_MOVE, onTouchMove, false);
instance.options.element.addEventListener(Event.MOUSE_UP, onTouchEnd, false);
instance.options.element.addEventListener(Event.TOUCH_START, onTouchStart, false);
instance.options.element.addEventListener(Event.TOUCH_MOVE, onTouchMove, false);
instance.options.element.addEventListener(Event.TOUCH_END, onTouchEnd, false);
}
}
function onTouchStart(e) {
drag = true;
target = instance.options.element || e.target;
startevent = e;
startpercentage = {x: (e.x/window.innerWidth)*100, y: (e.y/window.innerHeight)*100}
//console.log('onTouchStart', e, target);
e.preventDefault();
}
function onTouchMove(e) {
if (drag == true) {
var diffx = (startevent.pageX-e.pageX);
var diffy = (startevent.pageY-e.pageY);
target.scrollLeft += diffx;
target.scrollTop += diffy;

if (Math.abs(diffx) > 60) {axis = 'x';}
else if (Math.abs(diffy) > 100) {axis = 'y';}

//console.log('onTouchMove', target, diffx, diffy);
e.preventDefault();
}
}
function onTouchEnd(e) {
drag = false;

var endpercentage = {x: (e.x/window.innerWidth)*100, y: (e.y/window.innerHeight)*100}
var diffpercentagex = -(endpercentage.x-startpercentage.x);
var diffpercentagey = -(endpercentage.y-startpercentage.y);

var diffx = (window.innerWidth/100)*diffpercentagex;
var diffy = (window.innerHeight/100)*diffpercentagey;

//console.log('onTouchEnd', e, diffpercentagex, diffpercentagey);

//animate();

scrollAxis(diffx*1.5, diffy*1.5, axis);

e.preventDefault();
}
function animate() {
requestAnimFrame(animate);
console.log('animate');
}
function scrollAxis(diffx, diffy, axis) {
var x = target.scrollLeft;
var y = target.scrollTop;
var start = y;
var stop = start+diffy;
if (axis == 'x') {
start = x;
stop = start+diffx;
}

var distance = stop > start ? stop - start : start - stop;
if (distance < 50) {
if (axis == 'x') { instance.updatePosition(stop, y); }
else { instance.updatePosition(x, stop); }
return;
}
var speedY = Math.round(distance);
if (speedY >= 20) speedY = 20;
var step = Math.round(distance / 30);
var leapY = stop > start ? start + step : start - step;
var timer = 0;
//console.log(axis, distance, target, start, stop);
if (stop > start) {
for ( var i=start; i<stop; i+=step ) {
if (axis == 'x') { setTimeout("touchscroll.updatePosition("+leapY+", 0)", timer*speedY); }
else { setTimeout("touchscroll.updatePosition(0, "+leapY+")", timer*speedY); }
leapY += step;
if (leapY > stop) leapY = stop;
timer++;
}
return;
}
for ( var i=start; i>stop; i-=step ) {
if (axis == 'x') { setTimeout("touchscroll.updatePosition("+leapY+", 0)", timer*speedY); }
else { setTimeout("touchscroll.updatePosition(0, "+leapY+")", timer*speedY); }
leapY -= step;
if (leapY < stop) leapY = stop;
timer++;
}
}
this.updatePosition = function(x, y) {
//console.log('window.scrollTo', x, y);
target.scrollLeft = x;
target.scrollTop = y;
}
}
TouchScroll.prototype = new TouchScroll();

var touchscroll = new TouchScroll();
touchscroll.load({
'element': document.getElementsByTagName('body')[0]
});
//]]>
</script>