Event Listeners - Javascript - Tutorial 14

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ต.ค. 2017
  • Source Code - www.giraffeacademy.com/web-dev... This video is one in a series of videos where we'll be looking at programming in JavaScript. The course is designed for new programmers, and will introduce common programming topics using the JavaScript language.
    Throughout the course we'll be looking at various topics including variables, arrays, getting user input, loops, conditionals, interacting with the DOM and much more.

ความคิดเห็น • 63

  • @MrDarkogaucho
    @MrDarkogaucho 3 ปีที่แล้ว +18

    You're the best programming teacher on youtube in these beginner tutorials

  • @vadrif-draco
    @vadrif-draco 4 ปีที่แล้ว +36

    Most important video in this playlist so far, thank you for this great tutorial.

  • @MrStephen9876
    @MrStephen9876 5 ปีที่แล้ว +7

    This was just what I had been trying to find a video. I love your videos!

  • @jmarq1965
    @jmarq1965 2 ปีที่แล้ว +1

    I'm new to JS, and this video was exactly what I was looking for, in terms of teaching me how to use the listeners on a JS file linked to my HTML file. Thank you for this, definitely subbing!

  • @RobertGuilman
    @RobertGuilman 2 ปีที่แล้ว

    The cornerstone of front end, thanks for the explanation, you're a good teacher

  • @snackmami8371
    @snackmami8371 3 ปีที่แล้ว +6

    you explain things so good !! Big compliment from Austria

  • @joshuajoshua334
    @joshuajoshua334 2 ปีที่แล้ว +1

    I learnt html, css and javascript watching u...u are a guru

  • @amandavanderheyden4938
    @amandavanderheyden4938 4 ปีที่แล้ว +7

    This was soooo helpful, thank you so much! You explained it very well!

  • @simbaevans.3301
    @simbaevans.3301 หลายเดือนก่อน

    just finished learning Tutorial 14.Thanks to Mike

  • @elizabeth00653
    @elizabeth00653 21 วันที่ผ่านมา

    Love the font style and size too, super easy to read

  • @pasej5
    @pasej5 ปีที่แล้ว

    The best explanatory video on the web.. thank u

  • @ryanmattmcdonald
    @ryanmattmcdonald 5 ปีที่แล้ว +1

    Your stuff is great! Thank you!

  • @ohad7
    @ohad7 3 ปีที่แล้ว

    Thank you for sharing. That was really clear and helpful .

  • @driverguy5864
    @driverguy5864 6 ปีที่แล้ว +1

    very clear. very concise. thanks

  • @cristinaberceanu
    @cristinaberceanu 4 ปีที่แล้ว

    Man you saved my life.. thx so much

  • @prod.kashkari3075
    @prod.kashkari3075 4 ปีที่แล้ว +2

    From an organization perspective , what do you recommend, to add all event listeners in your html page inline, or have your html and styling seperate, and then have your JavaScript file specifically for adding event listeners and handle user interaction

  • @entity5678
    @entity5678 ปีที่แล้ว

    very easy to understand when mike dane teaches

  • @EtoBARAKUDAvasa
    @EtoBARAKUDAvasa 6 ปีที่แล้ว

    ty man.very nice instruction

  • @HalValla01
    @HalValla01 4 ปีที่แล้ว +2

    For anyone watching using classes in stead of ID in your html, this is what you have to do for event listeners:
    var something = document.getElemtsByClassName("class-name");
    for (var temp = 0; temp < something.length; temp++){
    let someVar = something[temp];
    someVar.addEventListener(THIS WILL WORK)
    }

    • @HalValla01
      @HalValla01 3 ปีที่แล้ว

      @Grease quala Little harsh, don't you think?

  • @hsmith5723
    @hsmith5723 3 ปีที่แล้ว

    Can I "call" an audio link inside that onclick function so when the button is clicked it makes a sound? Trying to add audio to a counter button.

  • @aquagrenh
    @aquagrenh 4 ปีที่แล้ว +1

    i enjoyed your tuts. How would you add event listeners to make a box grow, resize turn blue and fade out using 4 diff buttons.I am new to java script

    • @freddy7304
      @freddy7304 4 ปีที่แล้ว +2

      you can do that with css animations

  • @kartikkrishnan1753
    @kartikkrishnan1753 4 ปีที่แล้ว +7

    I have got a question... could someone please tell me what 'this' means inboth cases it is used.
    example.: this.width
    example.: onclick = "handleClick(this)"

  • @hamzaansari7715
    @hamzaansari7715 4 ปีที่แล้ว +2

    good stuff dude. helped me alot!

  • @marksiely4747
    @marksiely4747 ปีที่แล้ว +1

    This is simply the best explination I have seen for this part of javascript, one quesion: why do you use var image and not let image in index.html ? Thank you very much!

  • @bettyrizzo6167
    @bettyrizzo6167 2 ปีที่แล้ว

    I love you sensei

  • @freddy7304
    @freddy7304 4 ปีที่แล้ว

    my function isnt quite working this smoothly. I can only change the box-shadow, not the height.

  • @zoku5896
    @zoku5896 4 หลายเดือนก่อน

    Thanks!

  • @theasychair148
    @theasychair148 2 ปีที่แล้ว

    Was super helpful information, alough the :hover in css would have worked fine too.

  • @color.8467
    @color.8467 3 ปีที่แล้ว

    Why we events are usee with function to be executed?

  • @OrincyWhyteDesigns
    @OrincyWhyteDesigns 2 ปีที่แล้ว

    So with the image, you do mouse out to set the image back…. But for the button, what event listener would I use to set the button back to its original state 😞 help someone please

  • @dawooddalvi7704
    @dawooddalvi7704 2 ปีที่แล้ว

    best!!!

  • @burhanali9117
    @burhanali9117 4 ปีที่แล้ว +3

    good video
    just 1 suggestion
    keep your code zoom out because when you zoom in and start coding half of the code gets cut

  • @desmondfoo5050
    @desmondfoo5050 3 ปีที่แล้ว

    is it not working on visual studio code?

  • @kom219
    @kom219 6 หลายเดือนก่อน

    Nice

  • @japanwithkids
    @japanwithkids 2 ปีที่แล้ว

    I'm having some trouble with the addEventListener section (around 7 to 9 minutes in). Here's my code, which I've copied from the video several times and tried in both Safari and Chrome, but the image doesn't pop out at all:
    function handleClick(element){
    element.style = "background-color:blue;"
    }
    var image = document.getElementById("image");
    image.addEventListener("mouseover", function(){
    this.style ="box-shadow: 2px 2px 2px grey";
    this.width ="110"
    });
    The "image." and "this." both appear white in my .js document, not red as in Mike's. Any advice on how I can make this work?

    • @qliu9173
      @qliu9173 2 ปีที่แล้ว +1

      check if you remove the "onclick="handleclick(this) " on your image at your HTML page.

  • @raveson1990
    @raveson1990 ปีที่แล้ว

    Beat Man thx

  • @229axb7
    @229axb7 4 ปีที่แล้ว

    my image just disappears? I followed along exactly so im not sure what went wrong

    • @gery_3585
      @gery_3585 5 หลายเดือนก่อน

      incorrect file path but the image in the folder

  • @anilui8434
    @anilui8434 5 ปีที่แล้ว +3

    Clear voice and Zoom most plus points ..

    • @00el04
      @00el04 5 ปีที่แล้ว

      @stillFLiP ahhahahahah

    • @JavaScriptJolt
      @JavaScriptJolt 4 ปีที่แล้ว

      stillFLiP Zoom is really helpful if you’re somewhere waiting, or at work, and you only have your phone.

  • @sheezazainab1903
    @sheezazainab1903 3 ปีที่แล้ว

    Please make a video in React

  • @doodlefootball1571
    @doodlefootball1571 2 ปีที่แล้ว

    W3 school is very usefull

  • @faiaz.18
    @faiaz.18 9 หลายเดือนก่อน

    5:30

  • @BG-fo4si
    @BG-fo4si ปีที่แล้ว

    1:34, "onclick" is not javascript event. A "click" is. "onclick" is event handler.

  • @jayanthvenavenka7668
    @jayanthvenavenka7668 4 ปีที่แล้ว

    This would be a lot easier using CSS

  • @rajromil5
    @rajromil5 3 ปีที่แล้ว +2

    for those who are having trouble with the code in the video for mouseover and out effect can try the code below, its much more simple in my opinion .
    function bigImg(x){
    x.style.height="150px";
    x.style.width="150px";
    }
    function nrmlImg(x){
    x.style.height="100px";
    x.style.width="100px";
    }

    • @Asuuri
      @Asuuri 3 ปีที่แล้ว

      omggg thank you so much!! God bless! Stay safe and healthy!!

  • @CoconutwCoco
    @CoconutwCoco ปีที่แล้ว

    This usage of “this ” is just out of nowhere… it is so strange n feels so fluky…

  • @davidallsopp4030
    @davidallsopp4030 4 ปีที่แล้ว +1

    who hurt the person who disliked this video

    • @freddy7304
      @freddy7304 4 ปีที่แล้ว

      probably someone that tried to follow along with the video without learning html first.........." He didn't show us how to make the button"...

  • @__Peter
    @__Peter 4 ปีที่แล้ว

    Alert("your the fucking man;")

  • @truthmatters758
    @truthmatters758 3 ปีที่แล้ว +2

    man you gotta stop zooming in all the time it gets me confused

  • @kom219
    @kom219 6 หลายเดือนก่อน

    Nice