Notorious IE "Invalid Argument", line 4618 of jquery-1.4.2.js
I'm turning up an IE "Invalid Argument" error which the browser traces to line 4618, char 4 of jquery-1.4.2.js
I know enough to determine that that line part of a function that does something to set styles of elements, but I can't figure out much more than that.
The call I'm making is as follows:
- $evtthis.css({
- position: 'absolute',
- top: topVal
- });
I assume that the issue has to do with topVal. I'm able to trace it out and it is a number that is different for each div in the loop... so I'm not sure what I'm doing wrong... pasting complete script below. Please disregard the multitude of console.logs :{
- <script type="text/javascript">
- /* <![CDATA[ */
- var j = jQuery.noConflict();
- // Find selection of all time period divs and place them beside one another
- var $myTimes = j('.timeperiod');
- var pOff;
- var topVal = 0;
- function fineTune(){
- // Set the width for the two event divs that have to be 2 timeperiods wide
- var colWidth = String(parseInt(j('.timeperiod').css('width').replace('px', ''), 10) * 2 - 10) + 'px';
- //console.log(colWidth);
- j('#sentencing, #trial').css('width', colWidth);
- // Reset z-index for these columns so that the widened divs show properly
- j('#ninemos').css('z-index', 1000);
- j('#sixmos').css('z-index', 1001);
- //alert('placeholder');
- // Dynamically place each event div vertically lower than the one preceding it
- var $events = j('.event');
- for (var y = 1; y < $events.length; y++) {
- alert('place div loop, y = '+y);
- //console.log('move event index ' + y);
- var evtLess = y - 1;
- var $evtprev = j('.event:eq(' + evtLess + ')');
- var $evtthis = j('.event:eq(' + y + ')');
- alert('place div loop, y = '+y);
- var $thisheight = parseInt($evtprev.css('height').replace('px', ''), 10);
- //console.log('$thisheight is ' + $thisheight);
- pOff = $evtprev.offset();
- topVal = pOff.top + $thisheight;
- console.log(topVal);
- //console.log(pOff);
- alert('place div loop, y = '+y);
- $evtthis.css({
- position: 'absolute',
- top: topVal
- });
- }
- }
- // Dynamically position all timeperiod divs beside the first div, so they line up horizontally
- function positionCols(){
- for (var z = 1; z < $myTimes.length; z++) {
- var oneLess = z - 1;
- var $prev = j('.timeperiod:eq(' + oneLess + ')');
- //console.log($prev);
- var $this = j('.timeperiod:eq(' + z + ')');
- var $thiswidth = parseInt($this.css('width').replace('px', ''),10);
- //console.log($thiswidth);
- pOff = $prev.offset();
- //console.log(pOff);
- //console.log(pOff);
- $this.css({
- position: 'absolute',
- left: pOff.left + $thiswidth + 10,
- top: 5
- });
- }
- fineTune();
- }
- // Call positioning function on page load
- positionCols();
- // Reposition all timeperiod and event divs whenever the window is resized
- j(window).resize(function(){
- positionCols();
- });
- // Upon click of an event div, display the metadata that event contains
- j('.event').click(function(e){
- //console.log('event clicked');
- $this = j(this);
- var $myData = $this.metadata().descr;
- //console.log($myData);
- j('#dialog').html($myData).dialog({
- modal:true,
- width: 600,
- height: 220
- });
- });
- /* ]]> */
- </script>
Thanks for *any* assistance.
brokenindex