473,662 Members | 2,637 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 2530
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
4573
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 following code from an external javascript source file, dynamically created with PHP document.write('<a href="javascript:void(0);"
6
5398
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 its AutoPostBack set to true and has its SelectedIndexChanged event being handled in codebehind. The event fires as it should populating two more ddls. The problem is, the two ddls appear empty. I have used a javascript alert to look at the...
8
2479
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" type="text/javascript"> <!-- ; var newwindow = ''
15
2312
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 myhtml page in series manner like oragnisation0,oragnisation1,oragnisation2 and so on, and popup window will open onChange event of (oraganisation<iCount>) with one query string / parameter i.e value of oraganisation so that i will use that...
0
8857
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, 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...
0
8768
jinu1996
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...
1
8547
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,...
0
7368
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, 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...
1
6186
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 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...
0
5655
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();...
0
4181
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...
0
4348
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1999
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.