473,396 Members | 1,871 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help with YUI needed - onContentReady and onDOMready

I'm working on a website which will use the Slider control from YUI. It runs when onDOMReady is executed.

But my website has a global header that must be put on all pages, which has a site navigation menu which uses onContentReady. It caused the Slider control to stop working. And since I'm just an intern, I do not have the permission to change it. I need a way to make onContentReady and onDOMReady co-exist. Can anyone help?

http://developer.yahoo.com/yui/examples/slider/slider-simple_clean.html
The slider is created and its value is set to 20 after the page's DOM has finished loading.
Copy their source code, and add these right after the <body> tag:
Expand|Select|Wrap|Line Numbers
  1. <div id="topmenu"></div>
  2. <script type="text/javascript">
  3. YAHOO.util.Event.onContentReady("topmenu",alert("contentready"));
Then the slider is never created.
Jul 31 '08 #1
8 6605
Whoops, missed the </script> tag.
Expand|Select|Wrap|Line Numbers
  1. <div id="topmenu"></div>
  2. <script type="text/javascript">
  3. YAHOO.util.Event.onContentReady("topmenu",alert("contentready"));
  4. </script>
Jul 31 '08 #2
acoder
16,027 Expert Mod 8TB
According to this page, you can use them together.
Jul 31 '08 #3
According to this page, you can use them together.
I made these pages out of their example pages. As you can see, the page which both onContentReady and onDOMReady exist, the onDOMReady event never gets fired, the slider never gets initalized... not in Firefox 3, not in IE7, not sure about other browsers.

http://www12.brinkster.com/smileyface/1.htm
Jul 31 '08 #4
acoder
16,027 Expert Mod 8TB
I haven't tested so I'm not sure if it'll make a difference, but instead of an alert, try using the YUI logger to log a message onContentReady.
Jul 31 '08 #5
I haven't tested so I'm not sure if it'll make a difference, but instead of an alert, try using the YUI logger to log a message onContentReady.
Thanks for the suggestion.
http://www12.brinkster.com/smileyface/2.htm

Alright, so it seems that onDOMReady does get fired, but the slider doesn't work... any ideas?
Aug 1 '08 #6
acoder
16,027 Expert Mod 8TB
In Firebug, it shows this error:
Expand|Select|Wrap|Line Numbers
  1. this.baselinePos is undefined
  2. if (newPos[0] != this.baselinePos[0] || newPos[1] != this.baselinePos[1]) {
  3. http://www12.brinkster.com/smileyface/slider-debug.js
  4. Line 779
  5.  
when trying to drag the slider. It may be a bug in YUI, though I'm not sure. It'll probably be best to ask a YUI expert.
Aug 1 '08 #7
I am facing similar problem.
Does anyone know solution for this?
May 29 '09 #8
acoder
16,027 Expert Mod 8TB
Are you having the same problem with the slider? Post your code.

When using libraries, it's always a good idea, if possible, to upgrade to the latest stable version to get rid of possible bugs.
May 29 '09 #9

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

Similar topics

28
by: stu_gots | last post by:
I have been losing sleep over this puzzle, and I'm convinced my train of thought is heading in the wrong direction. It is difficult to explain my circumstances, so I will present an identical...
7
by: ChadDiesel | last post by:
Hello everyone, I'm having a problem with Access that I need some help with. The short version is, I want to print a list of parts and part quantities that belong to a certain part group---One...
7
by: Tina | last post by:
I have an asp project that has 144 aspx/ascx pages, most with large code-behind files. Recently my dev box has been straining and taking long times to reneder the pages in the dev environment. ...
10
by: Mae Lim | last post by:
Dear all, I'm new to C# WebServices. I compile the WebService project it return no errors "Build: 1 succeeded, 0 failed, 0 skipped". Basically I have 2 WebMethod, when I try to invoke the...
0
by: trip_jitendra | last post by:
I am using the following code: <PUBLIC:ATTACH EVENT=oncontentready ONEVENT="fnOnMouseOver()"> <PUBLIC:ATTACH EVENT=onmouseover HANDLER="onmouseover_handler"/> function fnOnMouseOver() { ...
3
by: Kitana907 | last post by:
Hi- I'm attempting to write a module that uses and updates info from two tables and does the following: Opens the recordset of a table called "tblstoreinv" If the Needed Field in the...
9
by: smartbei | last post by:
Hello, I am a newbie with python, though I am having a lot of fun using it. Here is one of the excersizes I am trying to complete: the program is supposed to find the coin combination so that with...
2
by: rookiejavadude | last post by:
I'm have most of my java script done but can not figure out how to add a few buttons. I need to add a delete and add buttong to my existing java program. Not sure were to add it on how. Can anyone...
32
by: =?Utf-8?B?U2l2?= | last post by:
I have a form that I programmatically generate some check boxes and labels on. Later on when I want to draw the form with different data I want to clear the previously created items and then put...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
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...
0
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,...
0
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...
0
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,...
0
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...
0
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
tracyyun
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...
0
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,...

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.