473,506 Members | 14,630 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

window.event syntax error...

5 New Member
Hi everybody,

I am new in javascript. I am working on resizing a control like Image by dragging it to a desired size at runtime. Now, my onmouseover event is working ok where the cursor type is change when position on particular part of control. But the function being called by my onmousedown event has error telling me a syntax error on line 90 (mouseDragImage). What is wrong with it? Thanks in advance.

den2005

Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. function mouseOverImage()
  4.         {
  5. //            var ev = window.event;
  6.             ev = window.event;
  7.  
  8.             var x;
  9.             var y;
  10.  
  11.             if(ev.pageX || ev.pageY){
  12.                 alert(ev.pageX + ", " + ev.pageY);
  13.                 x = ev.pageX;
  14.                 y = ev.pageY;
  15.             }
  16.             else
  17.             {
  18.                 x = ev.clientX + document.body.scrollLeft - document.body.clientLeft;
  19.                 y = ev.clientY + document.body.scrollTop  - document.body.clientTop;
  20.             }
  21.  
  22.             var wd = document.getElementById('Img3').offsetWidth;
  23.             var ht = document.getElementById('Img3').offsetHeight;
  24.  
  25.             var ctrlx = document.getElementById('Img3').offsetLeft;
  26.             var ctrly = document.getElementById('Img3').offsetTop;
  27.    . . . ..  ..  .
  28.  }
  29.  
  30.  
  31. function mouseDragImage()
  32.          {
  33.             var cursor = document.getElementById('Img3').style.cursor;
  34.             var ev = window.event;
  35. //            var ev = event;
  36.  
  37.             var newX = 0;
  38.             var newY = 0;
  39. //            var ox = 0;
  40. //            var oy = 0;
  41.  
  42. //            alert(cursor);
  43. Line 90 -->if(ev.pageX || ev.pageY){
  44.                 if (ox = 0 && oy = 0)
  45.                 {
  46.                     ox = ev.pageX;
  47.                     oy = ev.pageY;
  48.                 }
  49.                 else
  50.                 {
  51.                     newx = ev.pageX;
  52.                     newy = ev.pageY;
  53.                 }
  54.             }
  55.             else
  56.             {
  57.                 if (ox = 0 && oy = 0)
  58.                 {
  59.                     ox = ev.clientX + document.body.scrollLeft - document.body.clientLeft;
  60.                     oy = ev.clientY + document.body.scrollTop  - document.body.clientTop;
  61.                 }
  62.                 else
  63.                 {
  64.                     newx = ev.clientX + document.body.scrollLeft - document.body.clientLeft;
  65.                     newy = ev.clientY + document.body.scrollTop  - document.body.clientTop;
  66.                 }
  67.             }
  68.       ........
  69.     }
  70.  
Jul 12 '06 #1
1 2522
den2005
5 New Member
I have solve the syntax error...Now making resizing at runtime work...

den2005
Jul 12 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
4558
by: sentinel | last post by:
Hi all, I'm trying to reload a frame from a pop-up, but really cannot figure this out. Within my index.htm file, I make a link to call a pop-up frame with a javascript function that calls the...
6
5388
by: Scott Lee | last post by:
I am displaying an ASP.Net generated form in a popup opened with window.showModalDialog. The form contains DropDownList controls. The first ddl is populated via databinding to a datatable, has...
8
2464
by: johnsonholding | last post by:
Here is the code for a pop-up window that works in Firefox and not in IE - I get a java error or something, Here is the code : </script> <SCRIPT language="JavaScript"...
15
2290
by: Kapil Jain | last post by:
Dear All, What i need to achieve is : I am generating dynamic text boxes thru dhtml coding, i need onChange event of oragnistation text box i.e dynamically generated on click of "More" button in...
0
7308
Oralloy
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,...
1
7023
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...
0
5617
agi2029
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,...
1
5037
isladogs
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...
0
4702
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...
0
3188
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...
0
3178
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
410
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.