/    Sign up×
Community /Pin to ProfileBookmark

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>

[/quote]

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…[/i]“. When this happens, I cannot close the little screen by pressing on the X.

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

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@konithomimoJan 25.2006 — 
  • 1. You don't close any of your tables.

  • 2. That 'window' as you call it is just a div with an X in the corner and some text. That can be put anywhere.

  • 3. It might be easier to just use a popup, because then you can just change the text on a page instead of having to sort through your main page to edit the text.
  • Copy linkTweet thisAlerts:
    @IreallyneedhelpauthorJan 25.2006 — The one I am hoping to create would be the number 2 on your list. (div with an X)

    "div" is short for something? Maybe I can search for it at other sites also to obtain additional help.

    What does div mean?

    Thanks

    //Daniel
    Copy linkTweet thisAlerts:
    @konithomimoJan 25.2006 — A div is what you use for document "division". Meaning breaking your document into seperate parts so that you can effect certain parts at certain times without having to effect all of your document. notice the

    <div . . .

    in your code. That is a div. Basically it is a box that you put other code into. In the case of your code, you made the box, put some tables in it, gave it a border,and then put in some text for a title, along with a link with only an

    X

    as the value for it, thus closing the div . . . making it invisible.

    Then you added in your other text, and that was it.

    it takes less than 5 minutes for most programmers to make that. There are many tutorials on divs out there. Here are a few:

    http://www.w3schools.com/tags/tag_div.asp

    http://www.htmlcodetutorial.com/_DIV.html
    Copy linkTweet thisAlerts:
    @IreallyneedhelpauthorJan 26.2006 — Thanks man for the help

    //Daniel
    ×

    Success!

    Help @Ireallyneedhelp spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.4,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,

    tipper: @Samric24,
    tipped: article
    amount: 1000 SATS,
    )...