Drupal.Behaviors
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Drupal.Behaviors

  • 24,711 views
Uploaded on

LA Drupal Lightning Talk

LA Drupal Lightning Talk

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
24,711
On Slideshare
24,192
From Embeds
519
Number of Embeds
13

Actions

Shares
Downloads
132
Comments
3
Likes
2

Embeds 519

http://activelamp.com 179
http://www.slideshare.net 172
http://julian.pustkuchen.com 120
http://www.activelamp.com 31
https://duckduckgo.com 6
http://www.slideee.com 4
http://localhost 1
https://www.linkedin.com 1
http://translate.googleusercontent.com 1
http://al 1
http://74.125.127.160 1
http://dev.activelamp.com 1
http://jekyll.activelamp.com.s3-website-us-east-1.amazonaws.com 1

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Introducing Drupal.behaviors presentation by: Tom Friedhof
  • 2. Review jQuery Basics
  • 3. Review jQuery Basics $( [find something] ).doSomething();
  • 4. Review jQuery Basics $( [find something] ).doSomething(); $(“#tabs”).tabs(); CSS Selector jQuery UI Method
  • 5. The DOM has to be ready $(document).ready(function() { // Code Goes Here });
  • 6. The DOM has to be ready $(document).ready(function() { $(“#tabs”).tabs(); });
  • 7. The Drupal Way Drupal.behaviors.loadTabs = function(context) { // Code Goes Here };
  • 8. The Drupal Way Drupal.behaviors.loadTabs = function(context) { $(“#tabs”).tabs(); };
  • 9. Why use Drupal.behaviors? • Ability to override JS • Behaviors are re-attachable • Attach Behaviors to a specific context • HTML loaded via AHAH
  • 10. Why use Drupal.behaviors? • Ability to override JS • Behaviors are re-attachable • Attach Behaviors to a specific context • HTML loaded via AHAH Drupal.attachBehaviors(elem);
  • 11. Demo Drupal.behaviors
  • 12. Resources http://api.drupal.org/api/file/developer/topics/javascript_startup_guide.html/6 http://raincitystudios.com/blogs-and-pods/katherine-bailey/the-lowdown- jquery-drupal-part-two http://www.chapterthree.com/blog/josh_koenig/ handling_aysnchronous_data_drupal_session_materials
  • 13. Questions?