Click to See Complete Forum and Search --> : floating(always on top) image/table


svenicsale
06-03-2003, 09:03 AM
First let me tell you that my webpage is full of frames, so the JS code must be on the frame where the nav menu is... I am saying this because you could mistake and the picture would float to the edge of that frame and not in the edge of the whole main page.
Now, I wish to make a floating(always on top) table or picture (with modifyable width and hight) which will take position in the top-right angle of my website and will conceal anything that happens below him...What I mean is that it's dimension should match the dimensions of the right frame, and anything that happens in rightFrame will not be visible because the table will float on top of it. In this rightFrame, I imagined to open banners(the pay per click ones), but they should not be visible because of many things.... And even this frame will be small sized(3cm X 1cm), it will show scrollbars and spoil the main page...
And just to make sure you understand... When someone clicks on banner, the advertised website will open in rightFrame. But don't forget, the point is to make floating image/table....
I am pretty sure that this can be done by modifying <a href="http://forums.webdeveloper.com/showthread.php?threadid=10485&goto=newpost">THIS</a> script, but check it out and see...

Jona
06-03-2003, 09:48 AM
Give your table an ID and then put this at the top of all of that code:

var img = document.getElementById("tableID");

Jona

svenicsale
06-03-2003, 12:21 PM
And it will be on top off everything???? Even scrollbars??
The other question is: How to make it stand in fixed position of my choice. Example: on top and 50 pixels away from left side of page?

Jona
06-03-2003, 12:23 PM
<!--Example Table-->
<table id="tableID" style="position:absolute; top:50px; left:0px; z-index:90;">
<tr><th>Heading</th></tr>
<tr><td>Content</td></tr>
</table>
<!--End Example Table-->


Jona

svenicsale
06-03-2003, 03:13 PM
Yeah, thank, it did the job fine, but new problem arrises... I putted scipt into one frame, and the table should be positioned on top of other frame.... But, since the table is going out of the frame where it is scripted, it is not visible. Now what?
Remember, in the other frame, banners will popup, so I cannot putt script inside that frame[they must be in first(permanent) frame]. And the table must be on top of that frame so the opened pages would not be visible cause the table is on top of them.
I can send upload my webpage and picture you the whole stuff if neccessary.

Jona
06-03-2003, 03:19 PM
You cannot overlap frame bounderies with any HTML, CSS or JavaScript. It is not possible.

Jona

svenicsale
06-03-2003, 03:34 PM
I see. Maybe there is other way to do what I wish. I uploaded my webpage to www.beotel.yu/~****/MAIN/home.htm
Now, you see the red table? It is currntly in left frame, and I need to place it in one part of top frame(BTW, top frame consist of left and right frame).
Do you see the CLICK ME. Click it and watch. There will be a new page(banner) opened in the top frame. It shoul have a black backgorund.
Now, what I want is to putt my red table over the black part. Offcourse, the table colour I will change to white.
So do you know any other way this could be done? I guess that the banners could be opened in 1pxX1px, but that will be the last option, because I am not sure if that will work at all..
I forgot to make a point of all this stuff. I plan to make every link on my page open up two pages at once, and one of them is always a banner(pey per click one). But I don't want to make it so it would pop up in a new window because popups scare away visitors....

Jona
06-03-2003, 03:56 PM
onClick="document.getElementById('tableID').style.left='50px';document.getElementById('tableID').style.top='0 px';"


Jona

svenicsale
06-03-2003, 04:14 PM
Hmm. I didn't make it. The "red table" must be opened in a banner frame , right? So I don't see how will ONCLICK help, when it could just open a table in it's own window, although I didn't manage to do this either.
Could you make a similar page or rewrite my own just so wouldn't torture any more... That would be the quickest way.?

svenicsale
06-03-2003, 05:42 PM
Maybe the best would be if you could take a "CLICK ME" link from my page and then change it so when it is clicked, it opens two pages at the same time: one in "_self" and one in topFrame(the banner frame), and then also, when the page is opened in banner frame, the table appears over it so it is not seeable...
If you can't do it, please reply anyway....

Jona
06-03-2003, 06:11 PM
Actually, I'm lost on what you want at this point. The red table is supposed to appear inside of the top frame?

Jona

svenicsale
06-04-2003, 11:42 AM
Yeah, it is kinda confusing... But here, I uploaded a ZIP file that contains three pictures... Everything is quite self-explaining, so no need for me to talk much here... Just look at the pictures by order(1st,2nd then 3rd)... NOTE: I pictured my website as it is, so the lefFrame is for example unnecessary in whole this thing, but I putt it anyway so the picture would be better...

Jona
06-04-2003, 11:53 AM
OK, I see what you want. First of all it seems a little dishonest.. And second, you should just cover the whole frame with the banner in it with a white table. Simply make its width and height the size of the frame, position absolute, and z-index higher than anything else on the page. You can't hide the scrollbars.

Jona

svenicsale
06-05-2003, 10:43 AM
Wait, you say to make table in the banner frame.... OK, table wil be on top of everything, but as soon someone click any link, a new page will be opened in banner frame, and the table wil be lost, and the content will be seen... So, the table is made in one HTM page, and it stands in banner frame, but the new page(www.google.com for ex.) will "owerwrite" banner frame..... So, I don't see what will be acomplished by creating this table, when it will disapear anyway.....

Jona
06-05-2003, 10:59 AM
Just make the function run every time a link is clicked.

Jona

svenicsale
06-05-2003, 11:15 AM
I am not sure if we are thinking of same thing, but to resolve any misunderstanding and further debate, can you look at my attached picture No. 1, and write me an example code....
On the picture1, take the CLICK ME button, open up a www.google.com in topFrame with table over it, and link.htm in "_self"... But check the picture so the code would not be too different because I could get confused otherwise...
Also, if a table is white, will it be transparent??? It mustn't be for the effect to be successfull..

Jona
06-05-2003, 11:21 AM
You mean the pictures you attached in the zip file a few posts above? Or did you forget to attach something? :p

Jona

svenicsale
06-05-2003, 11:27 AM
Yes, the 1ST picture from the zip file I posted few posts up. You ill see the CLICK ME link and a current code belowe that.

Jona
06-05-2003, 11:35 AM
Just use onClick="top.bannerFrameName.innerHTML+='<div style=\'position:absolute;background-color:red;width:200px;height:400px;\'>';"

Jona

svenicsale
06-05-2003, 04:53 PM
Almost there... I tryed to combine your code with mine cde that opens two frames at once, but it gave me errors.. Maybe you wrote something wrong, or maybe I don't know how to combine this two... Here is my code, and you write how it should be..
<a href="noFrames.html" onClick="parent.topFrame.location.href='email_pics.htm';parent.mainFrame.location.href='page2.htm'; return false;">Click Me</a>

Jona
06-05-2003, 04:59 PM
That code will work if you have page2.htm as an HTML file on your server (if the file exists, in other words).

Jona

svenicsale
06-05-2003, 05:04 PM
Yes, but I need to putt these two together because there are two "onClick":

<a href="noFrames.html" onClick="parent.topFrame.location.href='email_pics.htm';parent.mainFrame.location.href='page2.htm'; return false;">Click Me</a>

&

onClick="top.bannerFrameName.innerHTML+='<div style='position:absolute;background-color:red;width:200px;height:400px;'>';"

These two must become one.

Jona
06-05-2003, 05:05 PM
Oh, I see. Yes, here is how you'd do that:


<a href="noFrames.html" onClick="parent.topFrame.location.href='email_pics.htm';parent.mainFrame.location.href='page2.htm'; top.bannerFrameName.innerHTML+='<div style='position:absolute;background-color:red;width:200px;height:400px;top:0;left:0;'>'; return false;">Click Me</a>


Jona

svenicsale
06-05-2003, 05:54 PM
Yap, that is how I did it also, but there is error somewhere in the code... It says that ; is missing in line 54, char 129.... Then, it didn't load page2.htm until I changed <a href="noFrames.html" into <a href="page2.html", which is probably conected with the error... But click on the link Click me and see for yourslef... It also didn't load anything in the topFrame, but that could also be as a consequence of an error...
I uploaded the new page to http://www.beotel.yu/~***/main/home.htm so the best thing you should do is to click the CLICK ME link(It is blue color and it's in the mainframe) and see what the error is...

Jona
06-05-2003, 06:08 PM
That link didn't work. Also, make sure you change the bannerFrameName part to topFrame or whatever the name of the banner frame is.

Jona

svenicsale
06-05-2003, 06:12 PM
http://www.beotel.yu/~***/MAIN/home.htm
Now it works(the link I mean)... I changed everything right, every frame is named corectly, but there is an error somewhere. You will see when you check the source...

Jona
06-05-2003, 07:42 PM
<a href="noFrames.html" onClick="parent.topFrame.location.href='email_pics.htm';parent.mainFrame.location.href='page2.htm'; top.bannerFrameName.innerHTML+='<div style=\"position:absolute;background-color:red;width:200px;height:400px;top:0;left:0;\">'; return false;">Click Me</a>


Jona

svenicsale
06-06-2003, 10:26 AM
You have made a mistake somwhere in the code, because when I paste it into Dreamweaver, I get return false;">Click Me</a> asthe name of the link, instead of just Click Me... But try yourself, paste it into some page and see...

Jona
06-06-2003, 12:25 PM
I've tested it this time, and it works.


<a href="noFrames.html" onClick="parent.topFrame.location.href='email_pics.htm';parent.mainFrame.location.href='page2.htm'; top.bannerFrameName.innerHTML+='<div style=\'position:absolute;background-color:red;width:200px;height:400px;top:0;left:0;\'>'; return false;">Click Me</a>


Jona

svenicsale
06-06-2003, 02:36 PM
Well, I don't know what to tell you... When I import it to my webpage, it says JavaScript error in line xxx, char xxx... It says that there is a ; missing there, but it doesn't make sense.... Don't bother with that stuff anymore.. Who knows what's wrong... Thank you however for everything so far... It is usefull even if I haven't acomplished the desired efect...
Can you please check this post? Maybe you will know the answer http://forums.webdeveloper.com/showthread.php?threadid=10485&goto=newpost

Jona
06-06-2003, 10:48 PM
Check your page's errors and lines, because the error you're getting is not coming from the code I posted.

Will check your other question,
Jona

dovlasr
03-18-2008, 11:06 AM
Could you please delete

www.beotel.yu/~***/MAIN/home.htm

as it reveals personal info to search engines!!! I tried contacting admins but have no right for PMs yet..