473,796 Members | 2,569 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using WZ JsGraphics with Mootools

2 New Member
Greetings to all coders.

I am new to js and my development is based on using frameworks such as Mootools and libraries such as Wz_jsgraphics. Recently working on my school project I have met with a problem of calling my function to draw something:

Expand|Select|Wrap|Line Numbers
  1. var jg = new jsGraphics();
  2. function drawArrow()
  3. {
  4.   jg.setColor("#ff0000"); // red
  5.   jg.drawLine(10, 113, 220, 55); 
  6.   jg.setColor("#0000ff"); // blue
  7.   jg.fillRect(110, 120, 30, 60);
  8.   jg.paint();
  9. }
  10.  
from within Mootools block window.addEvent ('domready', function() { .....

Does anyone has any suggestions pls ?
I know that jg.paint(); is the problem. Everytime the I call the function from within the mootools block the page freezes.
I have also tried everything that came up my mind such as calling it through other functions and stuff.

PLS HELP ME :)
Dec 6 '07 #1
3 4099
acoder
16,027 Recognized Expert Moderator MVP
Welcome to TSDN!

Have you tried calling it without using mootools?
Dec 7 '07 #2
Piliskner
2 New Member
Yes it works really fine the only problem is calling it within mootools.
Dec 8 '07 #3
truefontfamily
4 New Member
Maybe jg.paint() changes the DOM which then causes another call to the domready, resulting in an infinite loop.

Try replacing jg.paint() with this line:

Expand|Select|Wrap|Line Numbers
  1. if ( confirm( 'Continue?' ) ) jg.paint();
Now you need to confirm the paint() before it is called, so you can see if it is called again and again. Just cancel the 'Continue?' when it is called more than once.
Dec 10 '07 #4

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

Similar topics

7
11889
by: Seth Illgard | last post by:
I need one of those. But which one should I pick? Mootools looks great becouse I dont need to use the bad-document-but- still-great scriptaculus. What do you think?
4
5725
by: noagbodjivictor | last post by:
I don't know the problem with IE6. I have tried three methods, and they all failed. I eliminated the use of mootools' framework in method 3. MooTools is not the problem. Because the table is created but is not showing up. I have checked that with IE developper toolbar. 1st method for(var i = 0; i < thelines.length; i++) { var newrow = new Element('tr'); for(var j = 0; j < (posArray.length - 1); j++){
2
4507
by: manilal prajapati | last post by:
Hi, Using mootools I can implement either vertical or horizontal slider bar . But i want to implement both slider bar at once...
1
3602
by: soms2m | last post by:
HELLO ALL, I want to fill the parent window height with respect to the sub window height which is loading using ajax (mootools). For example if the parent window height is normal and the loading child window height is 1200px (saying), when the child window load the height of the parent window changs but the backgorund color which is given 100% not fill the parent window. I have given my example codes, please give a solution as soon as...
1
1786
by: Piotr Kaleta | last post by:
ekhm ... MOOTOOLS , if you don't know it sorry I won't be pasting docs from mootools.net manuals
2
2656
by: AndrewC | last post by:
I am using the Scriptaculous/Prototype libraries to build a project and I really want to have an effect like the mootools download page (http://www.mootools.net/download) where when you mouse over the lines at the bottom very fast, the lines do not highlight. They only highlight if your mouse is over them for slightly longer. Sadly, I can't use the mootools library, so I am hoping someone can point me in the right direction. I am...
1
1418
by: empiresolutions | last post by:
i need to upgrade a script for MoolTools that was built on version Build 86. I need it upgraded to work with v1.2. I have looked on the web for info on build 86, but im not finding much help. Im sure someone firmiliar with MooTools will be able to spot the upgraded functions that are needed. Thanks much in advance. This is the script that is need upgrading. Found here, http://www.zed23.com/2007/01/23/mootools-resizingtextarea-component/ ...
0
9680
marktang
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...
0
10228
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
10173
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
9052
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...
0
6788
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
5441
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
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2925
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.