Thursday, September 17, 2015

Jquery Even with JavaScript

In this lesson, you will know something about Jquery language you know, it is important in the JavaScript language and it has also actively used in the language or languages HTML and CSS.Now we're going to get it used JavaScript language, citing as an example the use of using even. Now let's start together:
1. dblclick: bauble click event use when use bauble click.
ex:
<h1>This is testing</h1>
<script>
$(document).ready(function(){
     $("h1").dblclick(function(){
        $(this).hide();
     });
});
</script> 

2. click: an event use when user one time click (single click).
ex:
<h1>This is testing</h1>
<script>
$(document).ready(function(){
     $("h1").click(function(){
        $(this).hide();
     });
});
</script>

3. mouseleave: an event use when user move mouse to other object.
ex:
<h1 class="mymouse">This is testing</h1>
<script>
$(document).ready(function(){
     $(".mymouse").mouseleave(function(){
        alert("Bye! now you leave from me");
     });
});
</script>



4. mouedown: an event use like even click.
ex:
<h1>This is testing</h1>
<script>
$(document).mouedown(function(){
     $("h1").mouedown(function(){
        alert('Now you Mouedown');
     });
});
</script>

5. mouseup: an event use after use click.
ex:
<h1>This is testing</h1>
<script>
$(document).mouseup(function(){
     $("h1").click(function(){
        alert("Now you use event mouse up");
     });
});
</script>

6. hover: an event use when user move mouse over object.
ex:
<h1>This is testing</h1>
<script>
$(document).ready(function(){
     $("h1").hover(function(){
        alert("New user use mouse mouse over me");
     });
});
</script>

7. focus: an event use when courser focus on object or control especially use with text box .
ex:
<h1>This is testing</h1>
<script>
$(document).ready(function(){
     $("h1").focus(function(){
        $(this).hide();
     });
});
</script>

8. blur: an event use when courser leave from object or control.
ex:
<h1>This is testing</h1>
<script>
$(document).ready(function(){
     $("h1").blur(function(){
        alert("Now your courser leave from me");
     });
});
</script>

9. mouseout: an event use when user leave mouse from control or object that focus.
ex:
<h1>This is testing</h1>
<script>
$(document).ready(function(){
     $("h1").mouseout(function(){
        alert('Now you move mouse go away from me');
     });
});
</script>

No comments:

Post a Comment