Are you first timer at lazacode.org? Why not join us and start exchange your knowledge with everyone. Register today!

jQuery Syntax

0 votes
11 views
added Apr 5 in jQuery by LC Marshal First Warrant Officer (8,170 points)

Example 1.

$(function() {
  var expiry = $('span.expiry_msg');  
  if ($(expiry).length) { 
   $(expiry).clone().appendTo('#footer > span.expiry-msg').addClass('footer-expiry').fadeIn(500);
  }
});
$(function() { ... });

is just jQuery short-hand for

$(document).ready(function() { ... });

1 Example

0 votes
responded 4 days ago by LC Marshal First Warrant Officer (8,170 points)

to apply same method to more than 1 variables

var viewQ = $('.tabs--primary.nav.nav-tabs li:first-child'),
    commentTitle = $('#comment-body-add-more-wrapper label.control-label'),
    editPreview = $('#edit-preview');

viewQ.add(commentTitle).add(editPreview).hide();
lazacode.org - Malaysia based Knowledge Exchange Platform, where you can share your finding or solution with other members of community.
...