Minggu, 08 September 2013

PHP Indonesia - Facebook: [ask] penggunaan "(this)" pada keterangan coding d...

PHP Indonesia - Facebook
PHP Indonesia is a community for everyone that loves PHP. Our focus is in the PHP world but our topics encompass the entire LAMP stack. Topics include PHP coding, to memcached handling, db optimizations, server stack, web server tuning, code deploying, hosting options and much much more. Youtube Channel : http://www.youtube.com/user/OurPHPIndonesia Twitter : @php_indonesia NOTE: Rules for Wall posting: https://www.facebook.com/groups/35688476100/doc/10151597056316101/ Daftar Keanggotaan : http://www.facebook.com/groups/35688476100/doc/10150671770741101/ 
Book your hotel early for a discount!

You can reap the rewards with great discounts at participating Pullman, M Gallery, Grand Mercure, Novotel, Mercure, ibis and Formule 1 hotels.
From our sponsors
[ask] penggunaan "(this)" pada keterangan coding d...
Sep 8th 2013, 08:14, by Fauzi Fauzy

Fauzi Fauzy 8:14am Sep 8
[ask]
penggunaan "(this)" pada keterangan coding dibawah ini apa y..?

<script type="text/javascript">
$(document).ready(function(){
$("div").mouseover(function(){

$(this).css({background:"red"});
});

$("div").mouseleave(function(){
$(this).css({background:"yellow"});
});
});
</script>

Surya Sheillendra 8:17am Sep 8
this untuk element yang terpilih (selector) contoh di atas untuksemua element DIV ketika mouseover atau mouseleave

Fauzi Fauzy 8:22am Sep 8
bukannya selector itu di isi dengan
nama tag, id, & class saja?
trus kalau diisi dengan this maksudnya ap?

Cahya Dsn 8:28am Sep 8
[oot] .."bukannya selector itu di isi dengan ..nama tag, id, & class saja?" really ?NO!

$("div").mouseover(function(){ //jika ada event mouseover pada tag <div> maka..
$(this).css({background:"red"}); // pada selector 'this'(atau selector 'ini', yaitu tag <div>, ubah style untuk property 'background'-nya menjadi 'red'
});

FYI:'this' adalah reserved word di native javascript .. cmiiw ^_^V .. ada baiknya belajar juga native javascriptnya.. jquery basic-nya 'kan native javascript juga..

Fauzi Fauzy 8:30am Sep 8
hm..
terimakasih pak atas ilmunya,, (y)

Ulumuddin Cahyadi Yunus 8:37am Sep 8
ya selector yg disebutkan di function

$("div").mouseover(function(){
$(this).css({background:"red"});
});

this = div yg sedang kena event mouseover

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions

Tidak ada komentar:

Posting Komentar