logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > Javascript and JS frameworks
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 02-28-2011, 10:00 PM   #1
tony09uk
 
Join Date: Oct 2010
Posts: 340
Default what does it all mean?????

When I first started to learn Dreamweaver I didn't realize coding was absolutely necessary. I when I set out to learn HTML, then CSS I decided that I wouldn't just copy and paste code, I wanted to learn to do it myself and get a complete understanding of it all before I moved onto any other code. At that point I didn't realise that I would need other code to get the page which I wanted.

I have broke my "vow" I have copied and pasted some code, from what the site says it is basic code, but I haven't a clue what im looking at. I am now concerned something may happen with my page and I won't have a clue how to make the necessary adjustments. Could someone please give a basic breakdown of what the below means or the direction to a site where I can get a quick basic overview of jquery. (i don't intend on learning any more that I have to anytime soon though)

$(document).ready(function() {

//Default Action
$(".tab_content").hide(); //Hide all content
$("ul.tabs li:first").addClass("active").show(); //Activate first tab
$(".tab_content:first").show(); //Show first tab content

//On Click Event
$("ul.tabs li").click(function() {
$("ul.tabs li").removeClass("active"); //Remove any "active" class
$(this).addClass("active"); //Add "active" class to selected tab
$(".tab_content").hide(); //Hide all tab content
var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
$(activeTab).fadeIn(); //Fade in the active content
return false;
});

});
tony09uk is offline   Reply With Quote
Old 03-01-2011, 12:25 AM   #2
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,164
Default

http://docs.jquery.com/How_jQuery_Works
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 03-01-2011, 08:33 AM   #3
gentleone
gentleone's Avatar
 
Join Date: Nov 2009
Location: Rhodes, Greece
Posts: 2,837
Default

The dollar sign is just an alias for 'jQuery', so you could also write jQuery(document).ready(function(). With document ready you say first load the DOM (Document Object Model), in other words first load all the HTML & CSS and then the jQuery function.

Furthermore I think I can't be more clear then the comments the author added after each line to explain what each line actually does.
__________________
www.gentlemedia.nl
gentleone is offline   Reply With Quote
Old 03-02-2011, 12:14 AM   #4
tony09uk
 
Join Date: Oct 2010
Posts: 340
Default

I thought I'd learnt!! I did the same with jquery as I did with css and HTML, soon as it was slightly different to anything i'd seen before I freaked, but now you've pointed out there comment markers, it seems so much clearer. and the tutorial will be of great help, many thanks both of you
tony09uk is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:44 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com