Author |
Message |
Registered: March 14, 2007 | Reputation: | Posts: 1,819 |
| Posted: | | | | Hello all
First, let me say that I have very little html knowledge.
I would like to create an HTML window where I can display the Tagline of a movie.
It doesn't have to be flashy; but I would like to be able to choose the font.
If someone could give me some pointers I'd be very grateful.
Pantheon |
|
Registered: March 13, 2007 | Posts: 793 |
| Posted: | | | | Is this what you want? If so, here's the code. Quote:
<HTML> <HEAD> <STYLE> BODY { padding: 0px; margin: 0px; background-color: #000053; } H1 { padding: 0px; margin: 0px; color: white; font: bold 26pt "Monotype Corsiva"; } </STYLE> <SCRIPT TYPE="text/javascript"> <!-- <DP NAME="HEADER_VARS" Language="JavaScript" Comments="True" IncludeCast="False" IncludeCrew="False"> /**************************************************/ var tagStart = ""; var tagEnd = ""; var tagline = "";
// Get the tagline text from the notes function GetTagline() { tagStart = DP_Notes.toLowerCase().indexOf("\<tagline") + 9; if (tagStart>8) { tagEnd = DP_Notes.toLowerCase().indexOf("\/\>", tagStart); tagline = DP_Notes.slice(tagStart, tagEnd); document.getElementsByTagName('h1')[0].innerHTML = tagline; } else { document.getElementsByTagName('h1')[0].innerHTML = " "; } } //--> </SCRIPT> </HEAD> <BODY onload="GetTagline();"> <center><h1></h1></center> </BODY> </HTML>
Just put: <tagline=[your tagline here] /> in the notes of the profile, without the []. And the beauty of it, is if you activate the "Use HTML for Notes" in the options, it won't show in your Notes window. To change the colors, font, etc., in the <Style> section, you can change the background color in the BODY section, and the font in the H1 section. | | | Last edited: by RossRoy |
|
Registered: March 14, 2007 | Reputation: | Posts: 1,819 |
| Posted: | | | | Wow!!
Thanks Ross...
I didn't actually expect you to write it for me....so I am eternally grateful!!
Neil |
|
Registered: March 13, 2007 | Reputation: | Posts: 17,334 |
| Posted: | | | | I actually wouldn't mind using this myself... but is there something I could add to make it so multiple tag lines are separated? As it works bow if I separate it with a ; it still just writes it as a continuous line.
So for something like... for 13 Ghosts we get..
13 Times the Thrills! 13 Times the Chills! 13 Times the Fun!;A ghost for each member of your family! Pick your favorite spook!
instead of...
13 Times the Thrills! 13 Times the Chills! 13 Times the Fun!
A ghost for each member of your family! Pick your favorite spook!
so is there anything I could add to make it work like the above? | | | Pete |
|
Registered: March 13, 2007 | Posts: 793 |
| Posted: | | | | No problem Neil, it took all of 10 minutes to do. Pretty easy when you can just reuse code from other HTML windows to put this together Pete, it's possible, but I have no idea how. Like I said above, I just mixed 2 HTML page together to create that, so I have no idea how I would separate each different tagline. I could check Xyrano's code to see how he does it for the Video window, or go the gallery route with a <nbtagline=3>, then a <tagline1=, <tagline2=, <tagline3=... But even then, I don't really know how I'd do that. I have no real knowledge of javascript, just basic programming training so I can see what does what in the code, but writing new one... Although it might be as good a time as any to actually tackle it Neil, to answer your PM, if I understand correctly, you want the window the retain the body color instead of going white if nothing is found, right? If so, find the line that says Quote:
document.write("You need to add <tagline=[your tagline here] /> to your notes for this to work");
and change it to Quote:
document.getElementsByTagName('h1')[0].innerHTML = " ";
I've also corrected it in the above script. | | | Last edited: by RossRoy |
|
Registered: March 13, 2007 | Reputation: | Posts: 17,334 |
| Posted: | | | | Thanks Ross... will see what I can see on the videos one... if not maybe someone else can give us an answer | | | Pete |
|
Registered: March 13, 2007 | Posts: 793 |
| Posted: | | | | Well I'm fairly certain Xyrano will pop in, if time permits. And for him, adding multiple tag handling should be a walk in the park I'm still impressed every time I see his gallery window. It's just awesome! | | | Last edited: by RossRoy |
|
Registered: March 13, 2007 | Reputation: | Posts: 3,436 |
| Posted: | | | | For those who may already use <tagline></tagline> (like for Mithirandir's Skin), the code above seems to work with that as well, without further modification necessary.
Thanks Ross!
I tried, but have not found a way so far, to align the tagline vertically in the middle of the window. Anyone have an idea? | | | Achim [諾亞信; Ya-Shin//Nuo], a German in Taiwan. Registered: May 29, 2000 (at InterVocative) |
|
Registered: March 13, 2007 | Posts: 793 |
| Posted: | | | | Quoting ya_shin: Quote: I tried, but have not found a way so far, to align the tagline vertically in the middle of the window. Anyone have an idea? It should already be centered, since the <center></center> is in the HTML code (they are center aligned here anyway). You could remove the <center></center> tags, and add Quote:
text-align: center;
to the H1 style section. |
|
Registered: March 13, 2007 | Posts: 793 |
| Posted: | | | | Oh and you can make the window look a little nicer by changing the line Quote:
<BODY onload="GetTagline();">
to Quote:
<BODY onload="GetTagline();" scroll="auto">
gets rid of the scroll bars if they're not needed. |
|
Registered: March 13, 2007 | Reputation: | Posts: 3,436 |
| Posted: | | | | I already added the text-align: center; and removed the center tags (cleaner html). But those are horizontal alignment, I want vertical too | | | Achim [諾亞信; Ya-Shin//Nuo], a German in Taiwan. Registered: May 29, 2000 (at InterVocative) |
|
Registered: March 13, 2007 | Posts: 793 |
| |
Registered: March 13, 2007 | Posts: 813 |
| Posted: | | | | I was just looking at that too. Change the h1 style to: Quote: h1 { position:absolute; width: 100%; top: 50%; text-align: center; color: white; font: bold 26pt "Monotype Corsiva"; } The padding, margin are not needed as inherited from the body ones. | | | Andy
"Credited as" Names Database |
|
Registered: March 14, 2007 | Reputation: | Posts: 1,819 |
| Posted: | | | | Quoting RossRoy: Quote: Neil, to answer your PM, if I understand correctly, you want the window the retain the body color instead of going white if nothing is found, right?
If so, find the line that says
Quote:
document.write("You need to add <tagline=[your tagline here] /> to your notes for this to work");
and change it to
Quote:
document.getElementsByTagName('h1')[0].innerHTML = " ";
I've also corrected it in the above script. Exactly what I wanted!! |
|
Registered: March 13, 2007 | Posts: 813 |
| Posted: | | | | As followup to the top: 50%, it needs a little tweaking depending on the size of the window and font size too.
As it is putting the text top at 50%, rather than the middle of the letters at the 50% point, so more likely you want something around 40-45% to get the text in the correct place. | | | Andy
"Credited as" Names Database |
|
Registered: March 13, 2007 | Reputation: | Posts: 3,436 |
| Posted: | | | | Thanks for the help, Ross and Andy.
Andy, you're code is much easier than most stuff I found so far. Will play around with those values a bit to see what suits me best. Thanks. | | | Achim [諾亞信; Ya-Shin//Nuo], a German in Taiwan. Registered: May 29, 2000 (at InterVocative) |
|