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 1983
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.heig ht" and "style.widt h".
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.zoo m, 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 follows:
myFunction(k) {
|
by: tshad |
last post by:
I have a function:
function SalaryDisplay(me)
{
var salaryMinLabel = document.getElementById("SalaryMin");
salaryMinLabel.value = 200;
alert("after setting salaryMinLabel = " + salaryMinLabel.value);
}
I also have an asp.net object:
|
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 = 111;
cout<< sizeof(g)<<" "<<sizeof(double)<<" "<<sizeof(*g)<<" "<<*g<<" "<<endl;
|
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",
true, DataSourceUpdateMode.OnValidation, String.Empty,
"d");
Where CurrentStep is a business object of type ProjectStep, with several
properties, such as the StartDate property shown above.
|
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 several parts of the DOM, but this does
not include the window object.
Thank you
| |
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.
Foo = function(type) {
this.num = 0;
this.type = type
this.trigger();
}
Foo.prototype.trigger = function() {
|
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 pass back an exception or
a null reference?
if an exception, i would imagine i should catch this and display a message
to the user?
thanks
|
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 possible, I just can't
get JavaScript to work with it.
Here is the code I am using, the error I get from IE is Object
Expected:
Hope someone can help! Any help would be much appreciated
|
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="<%= ViewData %>" />
-
|
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 model: that most OO features
are not
available for class object design without loss of POD-ness.
So, I'm more than leaning toward "bad" because of the limitations and
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| | |