I'm not sure what parts you're having difficulty with. Do you know how to position things using CSS? Do you have any kind of working knowledge of the JavaScript language?
I'm sorry to say that pretty much all JavaScript books suck. The only ones I'd recommend are: Flannagan (http://www.amazon.com/JavaScript-Definitive-Guide-David-Flanagan/dp/0596101996/ref=dp_ob_title_bk/178-1141996-4508037) (which is at least a good reference book on how to do browser programming, even if the description of the language itself is far from perfect), and possibly Crockford (http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742/ref=sr_1_1?s=books&ie=UTF8&qid=1283445753&sr=1-1), which is all about the language itself, and is just about the only book that deals with the language correctly.
You need only the first book, but the second one might give you a much better understanding of the JavaScript language than anything else you will find in paper or online.
PS: If your course books and assignments aren't working for you, DO TELL THE INSTRUCTOR. You may not be the only one who's having problems. FWIW, going from "no programming and HTML knowledge" to "move stuff around on the page without using any kind of libraries" is not trivial.
But the problem is the css. I get how the css assigns a name to the picture in that code, but it doesn't look like css I've ever seen before, and as far as I know doesn't use div's so I couldn't assign it to a stylesheet.Stylesheets/CSS can only assign values to the style of an element. You can't set things like ID or CLASS attributes using CSS. Where it gets confusing is that, for mostly historical reasons, some elements have attributes that are pretty much equivalent to styles (IMG has width and height attributes, for example, but with and height are also style attributes).
The code there is this:style=" left: 0px; position: absolute; top: 50px"
height=auto;
width=auto;
align=baseline;
src="ani_cat.gif">
I tried to change it to something more like this:
This worked to display the image, but it broke the animation.
I don't get why.
I found this website:
it doesn't look like css I've ever seen before
The code there is this:style= left: 0px; position: absolute; top: 50px"
height=auto;
width=auto;
align=baseline;
src="ani_cat.gif">
I wrote a good amount of fairly complex JS a few years ago, but I haven't touched it in a while.
Every O'Reilly book I've used was excellent, and I have several - including an older version of the JavaScript book. There was another book that was really good, but I don't remember the title. I'll look for it when I get home. It had lots of nice, stealable code. Finally, I used the site 'WebMonkey.com' for a lot of hints and tips.
there's a really funny one of them stacked up so you can really see the difference in thickness, but I couldn't find it ... hilar.
The part in bold is inline css, the rest are just regular html attributes that happen to also be controllable via css.
I tried to change it to something more like this:
the line in bold is an issue. you copied the html "style" attribute, it is un-necessary here as stand-alone CSS is ALL ABOUT style (as the name implies). Also, as SP mentioned, you cant assign the ID using CSS.
Oh alright, so only style=" left: 0px; position: absolute; top: 50px" is the css in this? The rest is html?? hmm...Yeah. the style="bla bla bla" stuff in the HTML is just a way to provide "inline" styles, and has the same syntax as CSS.
It's been a year since I learned css, and forgotten most of it, but it doesn't look like normal css I'm used to seeing at all.Looks normal to me :)
You have to assign the name of the image in html, so you can use the javascript function on it?It's easiest to assign an id or a class. Names are IIRC only valid for form widgets and links, not "normal" HTML elements, and in any case, names are harder to address. You can use other more advanced constructs, but in this case, I'd go for a plain ID, since you're only interested in moving and styling one specific item, and addressing things by id is the easiest and most portable method of accessing/modifying stuff in JavaScript (via the getElementById() method).
Ooh! Is it compatible with Windows 98?
I was looking through my software and found the perfect JavaScript program for EIBM--It's from the 90's and it's IBM branded!Show Image(http://ecx.images-amazon.com/images/I/51HxKfcxHcL._SL500_AA300_.jpg)
And mine's still new in the plastic wrap!
I was looking through my software and found the perfect JavaScript program for EIBM--It's from the 90's and it's IBM branded!Show Image(http://ecx.images-amazon.com/images/I/51HxKfcxHcL._SL500_AA300_.jpg)
And mine's still new in the plastic wrap!
I was looking through my software and found the perfect JavaScript program for EIBM--It's from the 90's and it's IBM branded!Show Image(http://ecx.images-amazon.com/images/I/51HxKfcxHcL._SL500_AA300_.jpg)
And mine's still new in the plastic wrap!
Java != JavaScript
uggggh. :doh:
YES, THANK YOU!
... I'm not horrible at flash but given the recent turn of events where everyone hates flash I figured I'd be good to learn more traditional and accepted methods.Flash haters?
You don't have to get your diaper in a tangle over a simple mistake:Show Image(http://media.ebaumsworld.com/2006/07/diaper.jpg)
You don't have to get your diaper in a tangle over a simple mistake:Show Image(http://media.ebaumsworld.com/2006/07/diaper.jpg)
Here ya go:
http://www.soybomb.com/ratpfink/javascript/
I was looking through my software and found the perfect JavaScript program for EIBM--It's from the 90's and it's IBM branded!Show Image(http://ecx.images-amazon.com/images/I/51HxKfcxHcL._SL500_AA300_.jpg)
And mine's still new in the plastic wrap!
Flash haters?
Flash is good. Flash makes things blink and zing and animate and adds interest and sheer excitement to each and every web visit. Some flash gimmicks are entertaining or original enough to make me pause and waste time just hovering across menu bars (making me briefly forget the content I was supposed to find). Maybe that's perfectly normal, or maybe I have mental problems (caused by years of studying things like Java, ahem).
But there is a darkside to flash. Like those bloaty video placeholders which take up half a screen slowly loading some needlessly hi-res video that won't do anything more than a static menu and some product photos could do better. Forcing the visitor to view lengthy presentations (probably about something else he isn't actually looking for, like google ads on youtube) is just not good. Animations which take a little time to play out without allowing the user to speed through to the content he wants are bad. Page layouts which play animations across dozens of tiny animated hover zones are very annoying when the visitor is trying to scroll through lists or click on something he sees at the faraway side of the screen. Anything which denies the visitor full use (and full speed) of his mouse/cursor control is simply begging for trouble. Any flash which forces the user to patiently wait in front of the door (even for a couple seconds) will cause many people to simply walk away and take their browsing elsewhere. And I'm talking broadband here ... how those poor 56K bastards survive on the internet is beyond me, but it can't hurt to help them limp along with lightweight pages that use flash in a sparing and smart manner. As in all things, small code runs faster. And the more potential security alarms your site triggers (ranging from harmless cookies to expired certificates to linking into external or ActiveX flash players), the more people with paranoid browser settings will be wary of remaining. The internet is a virtual land of limitless opportunity, people won't stay anywhere that annoys them because it takes only a moment to find another destination. It's all about speed; flash animation delays can be avoided, flash downloading times can be minimized. Don't be stupid and force visitors to automatically listen to songs or watch videos when they might be searching for something else. Usually something else very specific, because they found the link to your page on a search engine.
Avoid being seduced by the perils of the darkside and flash will be your ally. Once down the path of bloaty flash you begin, forever will it consume your site's destiny.
Oh wow that's amazing!!! Wow thanks so much. That uses a css and style that looks much more familiar. I'll have to ask you some questions about this when I try to redo it later today.
A life without Flash is a dull life indeed.
Yo, dawg, you might not want to share personal photos.
Next problem. We're doing forms. I have a form that gets passed to email, simply. It doesn't use a form engine, it just opens an email agent on the user's computer. The task is to put the day's current date in the body of the email automatically. I can figure out how to get the date in javascript, but not how to pass that variable to the body of the email. If I put the javascript in the body of a text field or something, obviously the scripting won't work, and just the scripting won't pass the value by being there.
I looked all over the web and found people with similar problems, but no solutions. Can't find anything in the book.
That should be one of these "mailto: link with extra arguments" things. AFAIK this is not standardized but enjoys fairly wide support nonetheless.Waaah? There is an RFC for that, namely RFC2368 - The mailto URL scheme (http://www.faqs.org/rfcs/rfc2368.html). I would recommend reading it, it might be dry material but it is after all the reference.
I know, but there are a ton of flash haters. I love flash. Unfortunately this has spread to even Apple, and I can't access my current website that I built with a flash menu on their devices. So I'm going to try rework it with javascript. That assuming that I can understand even an iota of it.
It's people like you who give flash a bad name. Never use flash for essential things like navigation!
It's people like you who give flash a bad name. Never use flash for essential things like navigation!
Ugh...just use PHP!!
php and javascript don't really have the same dynamic look and potential as the flash menu I was using.
I'm actually looking at some javascript libraries and some of them can make some pretty nice looking menus though. I've never used a javascript library though so not exactly sure what it will entail, but I have to say my eyes have been opened a little toward using more compatible means.
Currently I'm really stuck on this assignment though, and I need to get it done cause I have to get to classwork in my other classes.
I decided it's not really asking you to draw an oscilloscope, but to merely move a css object across the screen in the path of a sine wave, since javascript doesn't really have a native way to draw something like that. So similar to that other one I was having trouble with. I hope that's what it means at least. I'm having a horrible time just doing that as well. Some of these assignments are really cryptic.
My site uses CSS-only dropdown menus. To be honest, such "dynamic" menus that require flash are more of an annoyance than they are cool. As a user, I don't care about your fancy menu, I just want to be able to use the website. (Not that I haven't been guilty of similar things myself (Although not regarding flash)).
I decided it's not really asking you to draw an oscilloscope, but to merely move a css object across the screen in the path of a sine wave, since javascript doesn't really have a native way to draw something like that. So similar to that other one I was having trouble with. I hope that's what it means at least. I'm having a horrible time just doing that as well. Some of these assignments are really cryptic.
This site's got an example:
http://quantblog.wordpress.com/2010/05/26/animated-sine-wave-in-javascript-html5/