Home Download Buy Blog Forum Support

HTML5 & jQuery Packages

Re: HTML5 & jQuery Packages

Postby agibsonsw on Wed Feb 29, 2012 8:21 pm

Just a thought, but the installation instructions and Snippets folder might refer to TextMate rather than ST.

You could create a Packages\jQuery folder and perhaps just copy all the .sublime-snippet files to this folder. I'm assuming there is a way to download these files in one go, rather than individually :o

If you just require the snippets then I believe that no other files will be necessary. Andy.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm

Re: HTML5 & jQuery Packages

Postby MrMartineau on Thu Mar 01, 2012 6:40 am

syndrael wrote:Hello,
I've installed jQuery package - https://github.com/mrmartineau/jQuery
But could you tell me how to use it ?
Best regards
S.


There are many snippets/tab completions that make writing jQuery a lot faster. So, for example, writing '$' then tabbing would produce:
Code: Select all
$('string/element/array/function/jQuery object/string, context')
where the text between the quotes is hightlighted so you can use your own selector. 'this' completes to:
Code: Select all
$(this)


Basically, most of jQuery's API has a completion, just include a dot before the function (just as you would if you were normally typing it) then tab & with any luck there'll be a jQuery snippet for you to use. e.g.
Code: Select all
.fadeIn[TAB] --->  .fadeIn('slow/400/fast')

.hover[TAB] ---> .hover(function() {
   // Stuff to do when the mouse enters the element;
}, function() {
   // Stuff to do when the mouse leaves the element;
});

.animate[TAB] ---> .animate({param1: value1, param2: value2}, speed)

.css[TAB] ---> .css('property', 'value')
@MrMartineau || Setup Sublime Text quickly: Find out all you need at https://github.com/mrmartineau/SublimeTextSetup
MrMartineau
 
Posts: 78
Joined: Thu Jul 28, 2011 8:35 am

Previous

Return to Plugin Announcements

Who is online

Users browsing this forum: nadiam02 and 11 guests