AliMD / 1Tuts

:+1: Web Design Technology Tutorials
http://ali.md/tuts
62 stars 41 forks source link

C14 W3 S7 #642

Closed AliMD closed 10 years ago

AliMD commented 10 years ago

WorkShop

(function(){

  var
  btnsContainer = document.querySelector("ul.btns"),
  btns,
  btnsLen = 10,

  rand= function(a, b){
    var r= Math.floor(Math.random()*(b-a+1)+a);
    return r;
  },

  move=function(){
     this.style.top=rand(0, 90)+'%';
     this.style.left=rand(0, 90)+'%';
  },

  setEvents = function () {
    for(var i=0;i<btns.length;i++){
      btns.item(i).onmouseover=move;
      btns.item(i).onmouseover();
    }
  },

  generate = function () {
    var temp = "";
    for(var i=0;i<btnsLen;i++){
      temp += "<li>Click Me "+i+"</li>";
    }
    btnsContainer.innerHTML = temp;
    btns = document.querySelectorAll("ul.btns li");
  },

  init= function(){
    generate();
    setEvents();
  };

  init();

})();

HomeWork

ba tavajoh be bahse bala ye mesal khalaghane besazid masalan: http://jsbin.com/enEnAgem/1/edit

omidgharib commented 10 years ago

kh kh kh kerm daram :D

akbarzadeamin commented 10 years ago

امید سیخ نکن. چیزی نمی فهمم. حواسم پرت میشه

AliMD commented 10 years ago

jat khaliye, gharar bood biyay ke

omidgharib commented 10 years ago

@AliMD koja classha manam delam baratun khily tange :kissing: kampeydayid dar donyaye tech

akbarzadeamin commented 10 years ago

@omidgharib قرار بود منو تو دیوونه خونه عضو کنی. چی شد اون قول و قرار هات. اگه بدونی چه روزها که من صبر نکردم

omidgharib commented 10 years ago

@akbarzadeamin jiddan sharmande alan ozv shodi :)

hbehkamal commented 10 years ago

Homework:

  1. Sample 1
  2. Sample 2
AliMD commented 10 years ago

kharej az class va baraye ahl fan

Design Pattern ke khodam dar karham estefade mikonam

(function (root, doc, $, undefined) {
  var
  log = console,
  var1 = 1,
  fn1 = function () {
    log('fn1 launched ...');
    return ++var1;
  },
  init = function(){
    log('Initializing ...');
    fn1();
  };
  return root.ns1 = {
    fn1: fn1,
    init: init
  };
})(window, document, window.Zepto || window.jQuery).init();
omidgharib commented 10 years ago

@AliMD che kharejie in :D hal kardam khily ziyad mer30

hbehkamal commented 10 years ago

Help Me

how can i manage the speed ?? it's out of my skills !

http://jsbin.com/UGeFEHAz/4/edit?js,live

AliMD commented 10 years ago

vaghti az code haye man copy mikoni hamine dige az rahe khodet boro az in raveshi ke rafti be moshkelati mikhori be in ke yek code key ejra mishe deghat nemikoni

AliMD commented 10 years ago

man nemifahmam aslan chera animation dare ya aslan chera fall too set interval e nagoo chon man az set interval estefade kardam ke to ye kare dige dari aslna anjam midi kolan yadet bashe vaghti be browser migi in style ye element ro taghir bede hameye style haro taghir mide bad rasm mikone pass age hamzaman ham transition taghir kone va ham top har do baham set mishe va top transition nemikhoore baraye hamin top ro 1ms bad taghir midim http://jsbin.com/avUjeyo/3/edit?js,live vaghti dari misazi top ro dar range safhe bede ke vaghti kar nemikone befahmi koja moonde

hbehkamal commented 10 years ago

man hame ro az base khodam neveshtam, vali qablesh ye dore sari jsfun1-8 ro negah kardam ! tanha chizi k az shoma copy kardam in khat bood :

 boxs.item(i).style.webkitTransition = 'opacity 300ms, top 2000ms linear';

fall ro tu interval neveshtam chon madde nazaram in bood k har 500ms yek doone box biofte vali khob b har hal midoonam k eshtebahe !

akbarzadeamin commented 10 years ago

class work s8: http://jsbin.com/UkenofI/4/edit

hbehkamal commented 10 years ago

Next: C14 W3 S8

koorosh13hm commented 10 years ago

This is Deep. Lol, my code doesn't work if "console.log" is not used instead of merely using "log" on lines 15 and 19. The error would be : Uncaught TypeError: object is not a function.

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>MDs_Pattern</title>
    <script type="text/javascript" src="jq1102.js"></script>
</head>
<body>
    <script type="text/javascript">
        (function (root, doc, dolar, undefined) {
          var
          log = console,
          var1 = 1,
          fn1 = function () {
            log("fn1 launched ...");
            return ++var1;
          },
          init = function(){
            log("Initializing ...");
            fn1();
          };
          return root.ns1 = {
            fn1: fn1,
            init: init
          };
        })(window, document, window.Zepto || window.jQuery).init();
    </script>
</body>
</html>

What would be the cause? Thank you.