SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)

    outerContainer has no properties?

    Alright, this one is really confusing... I am using the Yahoo! UI Calendar widget and I am trying to hide it until a user clicks on an image link.

    My code is as follows:
    Code:
    <html>
    <head>
    <link href="style.css" rel="stylesheet" type="text/css" />
    <link href="calendar.css" rel="stylesheet" type="text/css" />
    <!-- Dependencies -->
    <script type="text/javascript" src="inc/yahoo.js"></script>
    <script type="text/javascript" src="inc/dom.js"></script>
    <script type="text/javascript" src="inc/event.js"></script>
    
    <!-- Source file -->
    <script type="text/javascript" src="inc/calendar.js"></script>
    <script language="javascript">
    var cal1;
    
    function init() {
       cal1 = new YAHOO.widget.Calendar("cal1","cal1Container", "5/2007", "5/5/2007-5/27/2007,5/30/2007");
    	this.link1 = document.getElementById('dateLink1');
       cal1.render();
    }
    function showCalendar1() 
    {			
    	var pos = YAHOO.util.Dom.getXY(link1);
    	cal1.outerContainer.style.display='block';
    	YAHOO.util.Dom.setXY(cal1.outerContainer, [pos[0],pos[1]+link1.offsetHeight+1]);
    }
    YAHOO.util.Event.addListener(window, "load", init);
    </script>
    </head>
    <body>
    <a href="javascript:void(null)" onclick="showCalendar1()"><img id="dateLink1" src="images/pdate.gif" border="0" style="vertical-align:middle;margin:5px"/></a>
    <div id="cal1Container" style="position:absolute;display:none"></div>
    </body>
    </html>
    When I click on the image to show the calendar I get a Javascript debugger error that says the cal1.outerContainer has no properties and the calendar does not show up.

    Anyone have any ideas?

  2. #2
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    I was able to solve this issue but now I have another one. I want each calendar to have an "X" in the top right corner to close the "pop-up". I have looked through the Yahoo! documentation but have not been able to find anything. Does anyone have any experience with the Yahoo! UI stuff and any idea how to do this?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •