This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Webmaster forum > September 2006 > Iframes and Mouse Position
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Iframes and Mouse Position
|
|
| wmanzo@yahoo.com 2006-09-24, 7:00 pm |
| I have a really professional conspiracy movie site
and I use tons of layers and an external scroll bar assembly.
I would like to put the various sections into MS Iframes and
in order to clean up the page but I find that the iframes interfere
with the getting the mouse coords from the screen which is
essential in moving the scroll bar around.
My test html is given below. With the iframe hidden the mouse coords
are obtainable. With the iframe visible things get buggy.
Where the "background_foriframe.html" is just a html file with
a background layer using a "DIV" tag.
<Div id='Main_Page_Background'
style='position:absolute;
filter:alpha(opacity=60);
clip:rect(0,5000,5000,0);
width:1px;height:1px;
left:0px;top:0px;z-index:50'>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td bgcolor="#AAAAAA" background="imgs/background_metalback.jpg">
<img src="imgs/trans.gif" id="main_page_bg" width=5000 height=5000
border=0>
</td></tr></table>
</Div>
<html>
<head>
<base href=" ">
<meta http-equiv="imagetoolbar" content="no">
</head>
<body bgcolor="#CCCCCC">
<Div id='Main_Background_Iframe'
style='position:absolute;
visibility:hidden;
clip:rect(0,5000,5000,0);
width:1px;height:1px;
left:0px;top:0px;z-index:50'>
<iframe src="background_foriframe.html" width="5000" height="5000"
name="background_iframe" frameborder="0" scrolling="no"
allowtransparency="true">
</iframe>
</Div>
<!--Click n Move Scripts-------------------------------------->
<!--Click n Move Scripts-------------------------------------->
<!--Click n Move Scripts-------------------------------------->
<!--Click n Move Scripts-------------------------------------->
<!--Click n Move Scripts-------------------------------------->
<!--Click n Move Scripts-------------------------------------->
<!--Click n Move Scripts-------------------------------------->
<!--Click n Move Scripts-------------------------------------->
<!--Click n Move Scripts-------------------------------------->
<!--Click n Move Scripts-------------------------------------->
<script language="JavaScript">
var ms_x, x_offset;
var ms_y, y_offset;
document.onmousemove = cm_mouseMove;
//--MOUSE MOVE-----------------------
function cm_mouseMove(e){
ms_x = event.x+document.body.scrollLeft;
ms_y = event.y+document.body.scrollTop;
if (ms_x < 0){ms_x = 0;}
if (ms_y < 0){ms_y = 0;}
document.xy_display.xcoord.value = ms_x;
document.xy_display.ycoord.value = ms_y;
return false;
}
//--MOUSE MOVE-----------------------
</script>
<!--Click n Move Scripts-------------------------------------->
<!--Click n Move Scripts-------------------------------------->
<!--Click n Move Scripts-------------------------------------->
<!--Click n Move Scripts-------------------------------------->
<!--Click n Move Scripts-------------------------------------->
<!--Click n Move Scripts-------------------------------------->
<!--Click n Move Scripts-------------------------------------->
<!--Click n Move Scripts-------------------------------------->
<!--Click n Move Scripts-------------------------------------->
<!--Click n Move Scripts-------------------------------------->
<!------------------------------->
<!--XY Coord Display------------->
<!------------------------------->
<Div id="XY_Coord_Dispay_Assembly"
style="position:absolute;
width:100; height:100;
clip:rect(0,500,500,0);
left:0px;top:0px;z-index:200;">
<form name="xy_display">
<Div id="XY_Coord_Background"
style="position:absolute;
filter:alpha(opacity=50);
width:100; height:100;
clip:rect(0,200,200,0);
left:0px; top:0px;z-index:100;">
<table border=0 cellpadding=0
cellspacing=0><tr><td>
<img src="imgs/xy_coord_body.gif" border=0
</td></tr></table>
</Div>
<Div id="X_Coor_Display"
style="position:absolute;
width:100; height:100;
clip:rect(4,33,17,2);
left:36px; top:0px;z-index:100;">
<table border=0 width=38 cellpadding=0 cellspacing=0><tr><td>
<input type="text" size="5" name="xcoord" value="0"
style="background-color:transparent;
color:black";>
</td></tr></table>
</Div>
<Div id="Y_Coor_Display"
style="position:absolute;
width:100; height:100;
clip:rect(4,33,17,2);
left:36px; top:15px;z-index:100;">
<table border=0 width=38 cellpadding=0 cellspacing=0><tr><td>
<input type="text" size="5" name="ycoord" value="0"
style="background-color:transparent;
color:black";>
</td></tr></table>
</Div>
<Div id="X_Coor_Display"
style="position:absolute;
width:100; height:100;
clip:rect(4,33,17,2);
left:36px; top:32px;z-index:100;">
<table border=0 width=38 cellpadding=0 cellspacing=0><tr><td>
<input type="text" size="5" name="x_layer" value="0"
style="background-color:transparent;
color:black";>
</td></tr></table>
</Div>
<Div id="Y_Coor_Display"
style="position:absolute;
width:100; height:100;
clip:rect(4,33,17,2);
left:36px; top:48px;z-index:100;">
<table border=0 width=38 cellpadding=0 cellspacing=0><tr><td>
<input type="text" size="5" name="y_layer" value="0"
style="background-color:transparent;
color:black";>
</td></tr></table>
</Div>
</form>
</Div>
<!------------------------------->
<!--XY Coord Display------------->
<!------------------------------->
</html>
| |
| richard 2006-09-24, 7:00 pm |
|
<wmanzo@yahoo.com> wrote in message
news:1158939749.417563.233400@e3g2000cwe.googlegroups.com...
>I have a really professional conspiracy movie site
> and I use tons of layers and an external scroll bar assembly.
> I would like to put the various sections into MS Iframes and
> in order to clean up the page but I find that the iframes interfere
> with the getting the mouse coords from the screen which is
> essential in moving the scroll bar around.
>
> My test html is given below. With the iframe hidden the mouse coords
> are obtainable. With the iframe visible things get buggy.
>
>
A lot of people might want to see the work in action. So they can see
firsthand what problems might be.
If you have a working page, with the errors you're seeking to correct,
posting the link would help.
I did notice you're using inline "style" as opposed to an off page CSS file
or even defining in the "head".
As well as embedded javascript.
The major problem with an iframe is, it is still a page by itself somewhere
else on your site.
What you need is a script that will reach out to that other page and work
with it.
Also what's the point of having such a huge iframe and no scrolling?
How am I expected to see what else there is?
| |
| wmanzo@yahoo.com 2006-09-24, 7:00 pm |
| richard wrote:
> <wmanzo@yahoo.com> wrote in message
> news:1158939749.417563.233400@e3g2000cwe.googlegroups.com...
>
> A lot of people might want to see the work in action. So they can see
> firsthand what problems might be.
> If you have a working page, with the errors you're seeking to correct,
> posting the link would help.
> I did notice you're using inline "style" as opposed to an off page CSS file
> or even defining in the "head".
> As well as embedded javascript.
>
> The major problem with an iframe is, it is still a page by itself somewhere
> else on your site.
> What you need is a script that will reach out to that other page and work
> with it.
>
> Also what's the point of having such a huge iframe and no scrolling?
> How am I expected to see what else there is?
When the Iframe is included on this sparse test page
the readout of the mouse position crashes which
means that the iframe is causing problems when it
should have no effect on obtaining the mouse
coords. If you look at my index_1.html page at
mansueact.com you'll find all your answers__all the
divs are visible and all the scripting is visible. I'd like
to tidy up the page with Iframes where the scripts
associated with the layers would be contained in
the corresponding iframe. The page would then just
be a group of Div tags with nested Iframe tags and I
would then be moving around the Divs and calling
functions in the Iframes. But the user wouldn't know this.
I'm assuming that if I can get the mouse coords with an
iframe visible then I can make the rest of the page work.
The major problem is my page scroll bar and that the user
cannot click and move it around the page when I use
Iframes. And, it is a very neat scroll bar.
Also, I only use and code for MSIE.
Thank you for your quick response.
>From Orlando,
The Banished Celebrity Publisher.
| |
| Jonathan N. Little 2006-09-24, 7:00 pm |
| wmanzo@yahoo.com wrote:
<snip>
> Also, I only use and code for MSIE.
Well for last month on my site my server log showed only 53% MSIE and it
has been dropping from 98% just a few years ago. So you are okay with
turning away maybe half your audience. Oh! Wait! I doesn't work in IE
either...maybe you aught to rethink your design?
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
| |
| Bob Barrows [MVP] 2006-09-24, 7:00 pm |
| Jonathan N. Little wrote:
> wmanzo@yahoo.com wrote:
> <snip>
>
>
> Well for last month on my site my server log showed only 53% MSIE and
> it has been dropping from 98% just a few years ago. So you are okay
> with turning away maybe half your audience.
Have you never heard of intranets? or company policies requiring the use
of IE?
Oh right, you would never work for a such a dictatorial company.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
| |
| Charles Sweeney 2006-09-24, 7:00 pm |
| Bob Barrows [MVP] wrote
> Have you never heard of intranets? or company policies requiring the use
> of IE?
> Oh right, you would never work for a such a dictatorial company.
Quite right too. I wouldn't work for any company if I could avoid it.
--
Charles Sweeney
http://CharlesSweeney.com
| |
| Leif K-Brooks 2006-09-24, 7:00 pm |
| Bob Barrows [MVP] wrote:
> Have you never heard of intranets? or company policies requiring the use
> of IE?
> Oh right, you would never work for a such a dictatorial company.
The OP didn't mention an intranet. Since he posted to alt.html, we can
only assume that he was talking about the Web.
| |
| Brian Wakem 2006-09-24, 7:00 pm |
| wmanzo@yahoo.com wrote:
> richard wrote:
>
>
> When the Iframe is included on this sparse test page
> the readout of the mouse position crashes which
> means that the iframe is causing problems when it
> should have no effect on obtaining the mouse
> coords. If you look at my index_1.html page at
> mansueact.com you'll find all your answers__all the
> divs are visible and all the scripting is visible. I'd like
> to tidy up the page with Iframes where the scripts
> associated with the layers would be contained in
> the corresponding iframe. The page would then just
> be a group of Div tags with nested Iframe tags and I
> would then be moving around the Divs and calling
> functions in the Iframes. But the user wouldn't know this.
>
> I'm assuming that if I can get the mouse coords with an
> iframe visible then I can make the rest of the page work.
>
> The major problem is my page scroll bar and that the user
> cannot click and move it around the page when I use
> Iframes.
You have much bigger problems than that. Your site is completely screwed in
Konqueror.
> And, it is a very neat scroll bar.
>
> Also, I only use and code for MSIE.
You are joking, right?
--
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png
| |
| Jonathan N. Little 2006-09-24, 7:00 pm |
| Bob Barrows [MVP] wrote:
> Jonathan N. Little wrote:
>
> Have you never heard of intranets? or company policies requiring the use
> of IE?
> Oh right, you would never work for a such a dictatorial company.
>
Gee that doesn't seem to be to tone of your glorious leader!
http://www.microsoft.com/mscorp/exe...operability.asp
Executive E-Mail: Bill Gates on Interoperability
Guess he can talk the talk but not walk the walk....
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
| |
| Dave Anderson 2006-09-24, 7:00 pm |
| Bob Barrows [MVP] wrote:
> Have you never heard of intranets? or company policies
> requiring the use of IE?
Have you never hear of portals? I work for a company that forces the use of
IE on every machine. We still code to standards because our intranet is
iChain-accelerated for remote access by any browser anywhere. The OP's
company could do the same in a day and he would be instantly affected by the
choice to ignore browser diversity.
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
| |
|
| wmanzo@yahoo.com a écrit :
>
> The major problem is my page scroll bar and that the user
> cannot click and move it around the page when I use
> Iframes. And, it is a very neat scroll bar.
the browser has lost its lifts ?
there is no way to use css and rule overflow: scroll; ?
> Also, I only use and code for MSIE.
and ?
> Thank you for your quick response.
In my mind, you need in your pages displayed in iframe a similar
function as that in main page.
function iframe_mouseMove(e){
ms_x = event.x+document.body.scrollLeft;
ms_y = event.y+document.body.scrollTop;
if (ms_x < 0){ms_x = 0;}
if (ms_y < 0){ms_y = 0;}
parent.document.xy_display.xcoord.value = ms_x;
parent.document.xy_display.ycoord.value = ms_y;
return false;
}
Don't know reactions of main coordinate function in this case :-(
--
ASM
| |
| richard 2006-09-24, 7:00 pm |
|
"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:eT3ZUpo3GHA.4764@TK2MSFTNGP02.phx.gbl...
> Jonathan N. Little wrote:
>
> Have you never heard of intranets? or company policies requiring the use
> of IE?
> Oh right, you would never work for a such a dictatorial company.
Most of us have heard of this. Obviously you must work for MSN.
AS this person has the page on a standard website, it therefor will be
available to the common man around the world.
One of the reasons I quit using IE was because it wouldn't render pages
correctly.
And if one has extremely sloppy code, as in this case, IE still manages to
render the page.
Therefor, IE does not conform to the standards of the W3C convention.
Which, BTW, IE was stolen from it's originator and M$ had to cough over a
huge bundle for the proper rights.
At least Firefox tries to conform to the W3C standards. IE never will and M$
don't give a shit.
Besides IE having numerous security leaks and bugs.
| |
| richard 2006-09-24, 7:00 pm |
|
<wmanzo@yahoo.com> wrote in message
news:1158951632.238276.319810@k70g2000cwa.googlegroups.com...
> richard wrote:
>
>
> When the Iframe is included on this sparse test page
> the readout of the mouse position crashes which
> means that the iframe is causing problems when it
> should have no effect on obtaining the mouse
> coords. If you look at my index_1.html page at
> mansueact.com you'll find all your answers__all the
> divs are visible and all the scripting is visible. I'd like
> to tidy up the page with Iframes where the scripts
> associated with the layers would be contained in
> the corresponding iframe. The page would then just
> be a group of Div tags with nested Iframe tags and I
> would then be moving around the Divs and calling
> functions in the Iframes. But the user wouldn't know this.
>
> I'm assuming that if I can get the mouse coords with an
> iframe visible then I can make the rest of the page work.
>
> The major problem is my page scroll bar and that the user
> cannot click and move it around the page when I use
> Iframes. And, it is a very neat scroll bar.
>
> Also, I only use and code for MSIE.
>
> Thank you for your quick response.
>
>
> The Banished Celebrity Publisher.
>
I looked at that page dude. It sucks.
Get rid of the scrolling binary crap on the notebork for starters.
If you insist on having it, at least put it to the right of the notebook.
Then there's all that mesh chain crap. Trash it.
As it stands now, the only thing I can read is where it says "top 10 alien
sites".
You do that shit to impress your coworkers, not for a real life website.
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|