Meager Explanation of the Offset Pull-down Menus.
I’ve gotten enough questions about the html on my DD – specifically the pulldown bars on the left side – that I figured it was time to dedicate an entry towards explaining said html. Basically, this saves me the trouble of having to actually explain it twice. I like having entries that I can point people to. I sat in the dining hall thinking how I should go about this, as I’ve never done an entry explaining html before. I decided the best way would be to explain how I figured it out.
First off, I’d like to say that some of you people really need to learn how to check source code. I don’t believe in copying and pasting code without having SOME clue as to how it works. See something on somebody’s DD that you want to use for your own? Check the source code. Don’t feel bad – source code is pretty much public domain. I doubt anybody will go after you saying, “Hey, DON’T STEAL MY BOLD TAG.” Also, all webpages are stored in your temporary internet files on your hard drive (or, at the very least, your RAM), so the code IS already on your computer.
I know I’ve gone over some of your heads already. Pressing on.
The obvious question for the html n00b is “How do I check source code?” You can do this in one of numerous way.
- If you have IE, GOTO the file menu. Click “View”. Click “source”. The source code of the page will show up in notepad. (I’ll just say that I have IE v6, your experience may vary.
- I was talking to Poptart, and she said she can’t view source like that. So I told her the following other way to do it. GOTO the file menu. Click “file”. Click “save as”. Select a folder to save the file in that you’ll actually remember. Hit save. Using Windows Explorer, find the folder where you saved it. (If you need instruction on this, I pity you.) Right-click the html file you just saved and click “Open With…”. If the option for notepad is already there, click it. If not, click “choose program”. Under the “other programs” area, scroll down and look for notepad. Click it. Click Okay. You’ve just openned the source code using a nice round-about method.
- Right-click anywhere on the page and click “View Source”. Amusingly, I never seem to use this method, even though it’s technically the fastest.
Odds are, the first time you see the source code to a typical page, you’ll go, “What the fuck is all that shit?!!” I’ll try to make this slightly less intimidating for you. You’re reading this, right? Open another window to your DD. (Or hell, my DD, if you want. The “diary contents” link is right there.) Choose your favorite method and look at the source code. I’m going to show you where that text that you type in for your DD shows up. In notepad, hit ctrl-F (or “Edit” – > “Find”). Type in something that you’ve typed into your DD. In my case, I might type “TimmyFromOD”, as I know that shows up on my DD. Hit enter (Or click “find next”) and you should see some of the shit you typed into that DD box. If you find yourself in a jumble of unfamiliar text, hit enter again until you see something familiar. Or, hell, just SCROLL DOWN until you see something familiar.
Okay, enough of this trivial shit. I did not, in fact, see pull-down menus offset like they are on my DD. I knew two things: the style portion of a img or table tag can offset them. That probably means nothing to you, so I’ll paste the code for the “Anyone But Bush” gif.
The important part of that tag is the “position: absolute” part. What does this mean? Instead of the position being relative to where the tag is placed, the position is now relative to the upper-lefthand corner of the window. The “left: 420” part means that it’s 420 pixels to the right of the upper-lefthand corner of the window. The “top: 26” means it’s 26 pixels down from the upper-lefthand corner of the window. I shall point out that I said “pixels”. By default, those numbers are pixels. How did I figure out what numbers to use? Extreme trial and error. After a while, you learn how much ten pixels is, or a hundred, or 1024 (the width of my resolution).
I don’t really remember where I got the tag for doing pull-down menus. So everybody can see what’s going on, I’ll crop some code and paste it.
- onchange=”location.href=this.options[this.selectedIndex].value;”>Witty Title!Witty Description!
A menu would be displayed here, but apparently, Bruce has declared menus be outlawed in entries.
That’s your basic functional menu. I won’t even explain the code after the “onchange”. I believe that was something I copied and pasted. I could explain, but it would totally go over everybody’s head. (Well, most.) Hmm. Pull-down menus. What the hell else is there to explain? The select tag initializes the menu. And option tags are the options that are displayed. Smack a tag at the end to signify the end of the menu.
Now, let’s combine the two concepts.
*thunder and lightning strike down*
- onchange=”location.href=this.options[this.selectedIndex].value;” style=”left: -4; ;top:400;width=139;font-size:9″>PoetryIf Only I Could CryMr. HappyNot My Sonoption value=”/entryview.asp?authorcode=C104458&entry=10205″>Bomb IraqI Believe in Bang Bang
That would be the entire code for the first pull-down menu I have. Yes, those menus eat a good portion of the chars on my DD. It’s as simple as this: The style portion of the initial select tag tells IE that the menu will be positioned relative to the window, not to where the tag appears in the code. You’ll notice that all the links are missing the “http://www.opendiary.com”. This was done purposely to save code. All the links are local links, so to speak.
Also, you’ll notice that all the code was displayed with the greater-than and less-than signs right next to the code. Normally, this causes your browser to read the code instead of just displaying it. However, I used the ascii (or is it unicode?) code for these characters. Specifically, < for < and > for >. It took me a while to memorize it, but it’s second-nature now.
Not enough chars to explain the sound that plays on my DD. Put those View Source skills to use and look for “wav” on my DD sou
*skims the technospeak because she is too inept to understand* *licks… something*
Warning Comment
This entry needs more masturbation. Or maybe you shaking your bum in pink panties. Something of, you know, substance.
Warning Comment
I guess it’s sad that I understood almost every word of this entry?
Warning Comment
I feel kind of fortunate that I understood most of that because my dad teaches this stuff.. but it still left me staring blankly wondering if we had any ice cream.. toodles.
Warning Comment
I think I actually do understand the code after onchange. Probably not, but…maybe? 😛
Warning Comment
HAHAHA…don’t steal my bold tag…hahahahahahahaha….oh God why is that so hilarious??
Warning Comment
Same way with me. I taught myself html and I can figure out other coding, it’s easy for me to spot the stuff that makes sense. but, I can’t explain it. Scotty says my style of coding is utterly bizarre. *shrug*
Warning Comment
*raises hand* I know who she is!! ^^^^^ 😉
Warning Comment
funny you posted this today… i was trying to do this today.. was unsucessful with the use of flash.does open diary support flash? x
Warning Comment
ryn: mini ribbons? ……..nooo. 😛 they say “Fantastic Friday” on em. I never wear em on the right day of the week. 🙂
Warning Comment
i understand pretty much everything! *does a geeky dance deelie* yay. anyway.. i used to have a drop-down menu.. but not any more. oh well. hugs,
Warning Comment
Thanks Tim.
Warning Comment
You know, some people do actually get mad at other people for “stealing their code.” I think it’s hysterical. I mean, like you went and invented this totally new piece of code? If you’d actually done that, it wouldn’t fucking work, so what would be the point?
Warning Comment
Dude, I take it back. You are in the right major.
Warning Comment
is this the first html explanation entry you’ve done? *gasp!* i like viewing the source for fun sometimes. just to revel in the little bit of geekdom i do have. 😀
Warning Comment
HTML treatises get me so hot.
Warning Comment
Ok, I have found the wav file stuff. Now hoever, I have the problem of not being sure how to get the music I want for it.
Warning Comment
OMG! I think I may have bloody sussed it! Thank you!
Warning Comment
I just had some jews. I feel sick.
Warning Comment
RYN 200 notes? I can totally see why, with entries like this! 😛
Warning Comment
A) I agree with the first notes B) I was thinking that this is what I want to learn what to do. I want to make the words bold and then when people click on them it takes them to the site. Later days.
Warning Comment
mmmm technology
Warning Comment
I thought Bush’s disease was the inability to say anything intelligent.
Warning Comment
Well, you can either join me in my campaign for world conquest by using red notes or you and I can be bitter rivals because I’ve been leaving red notes ever since I joined this pathetic excuse for an online diary site. I started reading some of your other entires but was interrupted by the brutal shrill of the bell, and now I have to write a story on hair dye, yay, so I
Warning Comment
will continue to read further into your mess of writing at a later date….until then, have a day. The Almighty
Warning Comment
^^^ This is better than the Gong Show. We’re competing with each other over note text color?
Warning Comment
Heh. I was going to write something about all the technospeak, then got totally distracted by The Red Note Wars. Funny.
Warning Comment
i like using the fast way. just because I can. and it’s fast. I got a red note and was hopeful that it was form you but alas, it wasn’t. I have lurked here and seen your red notes everywhere but have never gotten one. but then when I got a red note it wasn’t from you at all 🙁 yay for source code! *~*
Warning Comment