Line 22 Char 1 says object expected in the following code. For the life of me I can't figure out what it is. I'm sure I'm just overlooking some stupid bit of formatting or something. - <html><head>
-
-
<script type="text/javascript">
-
-
function ZoomIn() {
-
if document.getElementById('MyIFrame').style.zoom!='100%' {
-
newZoom= parseInt(MyIFrame.style.zoom)+10+'%';
-
MyIFrame.style.zoom =newZoom;
-
ZoomInID=window.setTimeout("ZoomIn()",1000);}
-
else window.clearTimeout(ZoomInID);
-
}
-
-
function ZoomOut() {
-
if document.getElementById('MyIFrame').style.zoom!='50%' {
-
newZoom= parseInt(MyIFrame.style.zoom)-10+'%';
-
MyIFrame.style.zoom =newZoom;
-
ZoomOutID=window.setTimeout("ZoomIn()",1000);}
-
else window.clearTimeout(ZoomOutID);
-
}
-
</script>
-
</head><body>
-
<iframe src="MyIFrame.htm" ID="MyIFrame" Name="MyIFrame" style="zoom:50%" onmouseover="ZoomIn();" onmouseout="ZoomOut();"></iframe>
-
-
</body></html>
8 1962
Line 22 Char 1 says object expected in the following code. For the life of me I can't figure out what it is. I'm sure I'm just overlooking some stupid bit of formatting or something. - <html><head>
-
-
<script type="text/javascript">
-
-
function ZoomIn() {
-
if document.getElementById('MyIFrame').style.zoom!='100%' {
-
newZoom= parseInt(MyIFrame.style.zoom)+10+'%';
-
MyIFrame.style.zoom =newZoom;
-
ZoomInID=window.setTimeout("ZoomIn()",1000);}
-
else window.clearTimeout(ZoomInID);
-
}
-
-
function ZoomOut() {
-
if document.getElementById('MyIFrame').style.zoom!='50%' {
-
newZoom= parseInt(MyIFrame.style.zoom)-10+'%';
-
MyIFrame.style.zoom =newZoom;
-
ZoomOutID=window.setTimeout("ZoomIn()",1000);}
-
else window.clearTimeout(ZoomOutID);
-
}
-
</script>
-
</head><body>
-
<iframe src="MyIFrame.htm" ID="MyIFrame" Name="MyIFrame" style="zoom:50%" onmouseover="ZoomIn();" onmouseout="ZoomOut();"></iframe>
-
-
</body></html>
Did you forget to close the "()" in both "if" controls, or it is your code?
Debasis Jana
Hi ,
Ur problem will be solved - if (document.getElementById('MyIFrame').style.zoom!='100%' )
and - if (document.getElementById('MyIFrame').style.zoom!='50%' )
in javascript if condition should have open and close braces
syntax: - if(condition)
-
{
-
-
}
-
-
else
-
{
-
-
}
Line 22 Char 1 says object expected in the following code. For the life of me I can't figure out what it is. I'm sure I'm just overlooking some stupid bit of formatting or something. - <html><head>
-
-
<script type="text/javascript">
-
-
function ZoomIn() {
-
if document.getElementById('MyIFrame').style.zoom!='100%' {
-
newZoom= parseInt(MyIFrame.style.zoom)+10+'%';
-
MyIFrame.style.zoom =newZoom;
-
ZoomInID=window.setTimeout("ZoomIn()",1000);}
-
else window.clearTimeout(ZoomInID);
-
}
-
-
function ZoomOut() {
-
if document.getElementById('MyIFrame').style.zoom!='50%' {
-
newZoom= parseInt(MyIFrame.style.zoom)-10+'%';
-
MyIFrame.style.zoom =newZoom;
-
ZoomOutID=window.setTimeout("ZoomIn()",1000);}
-
else window.clearTimeout(ZoomOutID);
-
}
-
</script>
-
</head><body>
-
<iframe src="MyIFrame.htm" ID="MyIFrame" Name="MyIFrame" style="zoom:50%" onmouseover="ZoomIn();" onmouseout="ZoomOut();"></iframe>
-
-
</body></html>
Hi ,
Ur problem will be solved - if (document.getElementById('MyIFrame').style.zoom!='100%' )
and - if (document.getElementById('MyIFrame').style.zoom!='50%' )
in javascript if condition should have open and close braces
syntax: - if(condition)
-
{
-
-
}
-
-
else
-
{
-
-
}
This is a syntactical problem.
The error message never comes with Syntactical problem.
Having runtime error it happens .............
I think he mistyped.
Debasis Jana
Thanks, I changed it to: -
<html><head>
-
-
<script type="text/javascript">
-
-
function ZoomIn() {
-
if (document.getElementById('MyIFrame').style.zoom!=' 100%') {
-
newZoom= (parseInt(MyIFrame.style.zoom)+10)+'%';
-
MyIFrame.style.zoom =newZoom;
-
ZoomInID=window.setTimeout("ZoomIn()",1000);
-
} else {
-
window.clearTimeout(ZoomInID);
-
}
-
}
-
-
function ZoomOut() {
-
if (document.getElementById('MyIFrame').style.zoom!=' 50%') {
-
newZoom= (parseInt(MyIFrame.style.zoom)-10)+'%';
-
MyIFrame.style.zoom =newZoom;
-
ZoomOutID=window.setTimeout("ZoomOut()",1000);
-
} else {
-
window.clearTimeout(ZoomOutID);
-
}
-
}
-
</script>
-
-
</head><body>
-
-
<iframe src="MyIFrame.htm" style="zoom:50%" ID="MyIFrame" onmouseover="ZoomIn();" onmouseout="ZoomOut();"></iframe>
-
-
</body></html>
-
But Now I get Lines 7, 8, 17, & 18 chars 5 'MyIFrame.style.zoom' is null or not an object which I can get rid of that by removing the .style from there, but it still won't do what I want it to, which is to change the zoom on the iframe. I must be missing something.
Thanks, I changed it to: -
<html><head>
-
-
<script type="text/javascript">
-
-
function ZoomIn() {
-
if (document.getElementById('MyIFrame').style.zoom!=' 100%') {
-
newZoom= (parseInt(MyIFrame.style.zoom)+10)+'%';
-
MyIFrame.style.zoom =newZoom;
-
ZoomInID=window.setTimeout("ZoomIn()",1000);
-
} else {
-
window.clearTimeout(ZoomInID);
-
}
-
}
-
-
function ZoomOut() {
-
if (document.getElementById('MyIFrame').style.zoom!=' 50%') {
-
newZoom= (parseInt(MyIFrame.style.zoom)-10)+'%';
-
MyIFrame.style.zoom =newZoom;
-
ZoomOutID=window.setTimeout("ZoomOut()",1000);
-
} else {
-
window.clearTimeout(ZoomOutID);
-
}
-
}
-
</script>
-
-
</head><body>
-
-
<iframe src="MyIFrame.htm" style="zoom:50%" ID="MyIFrame" onmouseover="ZoomIn();" onmouseout="ZoomOut();"></iframe>
-
-
</body></html>
-
But Now I get Lines 7, 8, 17, & 18 chars 5 'MyIFrame.style.zoom' is null or not an object which I can get rid of that by removing the .style from there, but it still won't do what I want it to, which is to change the zoom on the iframe. I must be missing something.
Is this "MyIFrame.style.zoom" a standard attribute.
I don't know.
Actually I am not very much familiar with CSS :-)
Can't you do it using change the size of "IFrame"?
Means ..... "style.height" and "style.width".
Debasis Jana
Well, if I change just the height and width, then the contents of the frame won't shrink or grow with the frame, it will only change the viewable area. That's why I've got to change the zoom style somehow.
The effect I'm going for here is to have a background image of (for example) a face, and the iframe will start out super-small, like around 2% of it's original size, and it will be placed over the pupil of the eye without borders, so that it almost looks like it's part of the picture, but when you mouse over the eye, it zooms the iframe in, which would contain a rotating ad such as a google adsense ad. I have done that already with just putting the final zoom size in the onmouseover event handler, but that doesn't provide the smooth zooming effect that I'm going for here.
As far as I know, .style.zoom is ok... there's a script here: http://msdn2.microsoft.com/en-us/library/ms535169.aspx
That uses it, and that script works (although they named their ID ozoom instead of MyIFrame, so in theirs it's ozoom.style.zoom, but it should work the same).
Well, if I change just the height and width, then the contents of the frame won't shrink or grow with the frame, it will only change the viewable area. That's why I've got to change the zoom style somehow.
The effect I'm going for here is to have a background image of (for example) a face, and the iframe will start out super-small, like around 2% of it's original size, and it will be placed over the pupil of the eye without borders, so that it almost looks like it's part of the picture, but when you mouse over the eye, it zooms the iframe in, which would contain a rotating ad such as a google adsense ad. I have done that already with just putting the final zoom size in the onmouseover event handler, but that doesn't provide the smooth zooming effect that I'm going for here.
Then you have to wait for a CSS experts.
Debasis Jana
Ok, so I changed and simplified the code, everything works now with no errors, with only one problem. If I mouse out before the iframe has finished zooming in, it stays at it's zoomed in size until I re-mouseover and mouseout again. If it absolutely has to work like that, ok, but I'd prefer it not to. I need one command to get this part to work as well, I need an IF statement that checks to see if the mouse is still over the object. Does such a thing exist? I know it's a long shot due to the redundancy between that and an onmouseout event, but I can hope, right?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Bill |
last post by:
I call a function in my .js file like this:
onClick="location.href='blank.html' +
generateSearchStringFromForm('section')"
where section is the name of my form.
The function is defined as...
|
by: tshad |
last post by:
I have a function:
function SalaryDisplay(me)
{
var salaryMinLabel = document.getElementById("SalaryMin");
salaryMinLabel.value = 200;
alert("after setting salaryMinLabel = " +...
|
by: jimjim |
last post by:
Hello,
This is a simple question for you all, I guess .
int main(){
double *g= new double;
*g = 9;
delete g;
cout<< sizeof(g)<<" "<<sizeof(double)<<" "<<sizeof(*g)<<" "<<*g<<" "<<endl;
*g =...
|
by: David Veeneman |
last post by:
Hi-- I'm trying to databind a business object to several controls using the
DataBindings property of the controls, like this:
textBoxStartDate.DataBindings.Add("Text", CurrentStep,
"StartDate",...
|
by: yb |
last post by:
Hi,
Is there a standard for the global 'window' object in browsers? For
example, it supports methods such as setInterval and clearInterval, and
several others.
I know that w3c standardized...
|
by: Andrew Poulos |
last post by:
With the following code I can't understand why this.num keeps
incrementing each time I create a new instance of Foo. For each instance
I'm expecting this.num to alert as 1 but keeps incrementing.
...
|
by: TS |
last post by:
If I was to have my biz layer ask the data layer to load a particular object
based on key field info i pass to it, and it cannot create the object
becaues it isnt' in the Db, should the data layer...
|
by: MayBoy |
last post by:
Hi There
I am trying to use the Goto method of the Word ActiveX object. I am
trying to open a document and go to a named bookmark. If I use this
code in VB it works, so I'm sure the approach is...
|
by: thj |
last post by:
Hi.
I've got this form that I'm trying to validate:
<form id="periodForm" action="" method="post">
<p>
Periode:
<input id="startDate" name="startDate" type="text" size="7"
value="<%=...
|
by: tonytech08 |
last post by:
What I like about the C++ object model: that the data portion of the
class
IS the object (dereferencing an object gets you the data of a POD
object).
What I don't like about the C++ object...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| | |