Log in

View Full Version : Javascript packages 101



baldrn
11-21-2010, 12:16 AM
Is this how most of these javascript packages work?
Overall?
Unzip...
-upload js files to js dir
-upload images to images dir
-upload css file to css dir (do I need to put the site css in that folder as well? right?does that matter really?
-in the header link the images like:

<a href="images/fish.jpg" rel="lightbox"><img src="images/tn_fish.jpg" width="100" height="75
" alt="" /></a>
making sure the first href is the big picture to be expanded and the src is the tn?..right? I'm sure that would be relative to what you want the script to do to what picture.

Just trying to get my head wrapped around this process ground up. I don't write the code, obviously. Hats off to you guys/gals! But, I can alter, copy/paste pretty good once I find a 'template' that works.
I hope I asked that question correctly.
Just trying to find a sort of pattern/process here.
Thanks,
Mark

jscheuer1
11-21-2010, 04:01 AM
Sorry, no pattern or process really. If there's anything like that it's the pattern and process of present day computers, insofar as how filenames, extensions and paths are recognized, how HTML, javascript and css work in general, that sort of thing.

Other than that, a particular script comes with its own particular set of instructions. Some of these are easier for a novice to understand and follow than are others.

If a script comes with a zip which when expanded contains a fully functional demo, then that demo constitutes a template that can be followed for that particular script.

Often a script will use a particular library. When it does, the author may choose to explain its use in terms familiar to anyone familiar with that library. Lightbox (version 2 by Lokesh Dhakar) uses prototype and some other prototype based libraries, but the instructions don't use any of the prototype based jargon.

If you find a place, like Dynamic Drive or JavaScript Kit (there are many, many others), where an effort is made to explain the use of each script in fairly consistent ways, and you can understand that method of explanation, that gives you entrance to a large body of scripts you may then use.

Ultimately though there is no substitute for understanding the basics and knowing where to go to find out answers when things get more complex. That way you can take virtually any script and make it do what you need or want it to.

If you're having problems with a particular script and are stumped, the best thing to do (in these forums) is to put up a live demo of your best effort and ask for help on it in an appropriate sub forum. Give the link to your best effort, identify the script and its demo page, and state the problem as you understand it in your post. Someone here should be able to take it from there.

baldrn
11-21-2010, 12:53 PM
Very good explanation, thanks John.
There are so many websites designed to help learn Javascript but they usually start in the deep end of the pool.
Are there any I can look at that start in a kiddie pool, shallow end, deep end? I hate to bother people with questions that I might can figure out, but I don't know where to begin.
Just like with this one i"m working on, the lighbox. I got some help and figured out how to make one pic work find. But I want to do a series of pics. Like the example on that page. But I don't understand how this is interpreted:


include a group name between square brackets in the rel attribute
(I posted that question, but so far nobody has answered it)
I know what square brackets are, but does that mean put those strings (is that the right word?) <a href="images/image-1.jpg" rel="lightbox[roadtrip]">image #1</a>
in the lighbox.js?
I mean 'in the rel attribute'....since the instructions said 'rel lighbox' to activate it, I assume it means the lightbox.js.
But, just anywhere in that js?
See, a lot of it is simply understanding verbiage.
Thanks again for the help.

jscheuer1
11-21-2010, 04:05 PM
As for your script question see my response here:

http://www.dynamicdrive.com/forums/showthread.php?p=241866

Good sites for the basics:

http://www.w3schools.com/

and:

http://www.howtocreate.co.uk/

Good HTML and css references once you understand the basics or before if you just need clarification on one thing:

http://www.blooberry.com/indexdot/html/index.html

and:

http://www.blooberry.com/indexdot/css/index.html

With all of these it's a good idea to familiarize yourself with the organization of each site. This will help you to use each one for whatever future need might arise, as well as help you get a feel for which one(s) might be most likely to get you to the information you need on any particular problem the quickest.

There are many other sites, these are just ones I'm familiar with. I still use them all, though the uk (howtocreate.co.uk) site less so. I include it because many others here at the forums swear by it. I don't believe any of them are perfect. But they are certainly great starting points and the information that is accurate and well thought out far outweighs the occasional misleading/missing/poor practice encouraging tidbit.