Hello everyone,
thankfully I found this forum, I hope you guys can help me.
Let me start out by saying that I know abosolutly nothing of Javascript. I admire all of you who have mastered it or know how to use it, so I ask for your help.
My situation is this: (I’ll try to make a long story short)
I am making a website for a paintball place that opened in my city (I am in Brazil). My site is amature stuff, but its not that bad. Its not up yet, though.
The website is ready, and the owner of the paintball place had an idea. He wanted me to put a little “screen” (window, popup, I dont know the word) on the top right of the page, so that new offers could be posted there, like discounts for groups, tournaments and etc. There should be a little X button to close that screen.
I was searching for examples, and I came across the perfect one. I visited some cjb.net website, and there was their ad screen on the top right, just like how I wanted it. I opened their Source window and Ctrl+C it. (very lame I know)
So, I have been messing with it, and I got it to look like what I want. Here is my html code:
[quote]
<html>
<head>
<style>.adHeadline
{color:#0000ff;font-family:arial;font-size:12px;text-decoration:underline}
.adText{color:#000000;font-family:arial;font-size:12px;text-decoration:none}
</style>
</head>
<body bottommargin=”0″ leftmargin=”0″ marginheight=”0″ marginwidth=”0″ rightmargin=”0″ scroll=”no” topmargin=”0″>
<iframe frameborder=”0″ height=”100%” src=”index2.html” width=”100%”>
</iframe><div id=”target” style=”position:absolute;right:0;top:0″>
<table cellpadding=”1″ cellspacing=”1″><td bgcolor=”#000000″>
<table cellpadding=”1″ cellspacing=”1″><td bgcolor=”#329900″>
<table cellpadding=”1″ cellspacing=”1″ width=”100%”><td align=”left”>
<font face=”verdana” size=”4″ color=”white”>SUPER PROMOÇÃO !</font>
</td>
<td align=”right” bgcolor=”#d4d0c8″ width=”1″>
<a href=”javascript:void(0)” onClick=”document.all.target.style.visibility=’hidden'” onMouseOut=”window.status=”;return true” onMouseOver=”window.status=”;return true” style=”color:#000000;font-family:arial;font-size:12px;font-weight:bold;text-decoration:none”>X</a>
</td>
</table>
</td>
<tr>
<td bgcolor=”#ffffff”>
<font face=”verdana” size=”2″ color=”#3333cc”>
Você trazendo mais 9 amigos, a sua <br>
entrada é gratúita! Com um total de <br>
10 pessoas, o organizador do grupo <br>
ganha um Kit Game (arma, mascara, <br>
bolinhas, gás, etc.) de graça. <br>
<b>Organize a sua turma e venha!</b></font>
</td>
<tr>
<td bgcolor=”#329900″>
<table cellpadding=”1″ cellspacing=”1″ width=”100%”>
<td align=”left”>
</body></html>
NOTE: both of the words “target” were originally “cjb1138199577”. I changed just to look better.
When I click to preview the site, everything works perfectly. However, it does not work properly when I open the HTML file. When I open my site on IE, I get a message that says “[i] To help protect your security, Internet Explorer has restricted this file from showing active content that could access your computer. Click here for options…
Also, that onClick segment of the code is very “sensitive”. Any little part your take out (document.all.target.style.visibility), the X does not work anymore in preview mode.
This same screen works perfectly when I visit the cjb website, but now it does not work for me.
Is there any way you guys can help me? I really want to make this little “announcement corner window” work. What should I do so IE will not block it from working?
Thank you very much for your time and help
//Daniel