Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts

    firebug throwing error -- 'zxcobj.srtfin[0] has no properties'

    Hey all,

    I finally managed to reliably cause an error to occur (using FF and Firebug).
    A screen shot of error has been uploaded to www.enviromark.ca/head/zxcobj.srtfin[0].gif

    How you can recreate this is by following these steps... it is somewhat tricky to make happen, but it happens about 10 times a day to me as I preview the page
    • go to www.enviromark.ca/head/YPPInclude.php
      • as you can see, onmouseover an underline appears under the text links
    • now, if you can manage to do it, hit F5 (refresh) and as the page is refreshing onmouseover the any of the text links. You will see that the link you just onmouseover'd will stay underlined, and every time you go over it with your cursor it throws another error


    Would simply using a watchdog() script prevent this from occurring?

    ---------------------------

    The second glitch occurring is a simple one to fix so i figured I would post it here
    • go to www.enviromark.ca/head/YPPInclude.php
    • click the fourth B&W vertical icon
    • Click 'Medical Services' and the top border will be the same color as the text
      • (what i want -- i set that here:
        Code:
        zxcBorder('border-Top',this,1000,'#FFFFFF','#0000A0','solid #0000A0 1px',2,0); return false"
    • Now click any other text link (such as 'Clinics')
    • and the click 'Medical Services' again.
    • The top border reverts to being black even though it is set to something else....


    Any ideas?
    Last edited by canadianjameson; 08-23-2007 at 09:39 PM.
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,505
    Thanks
    3
    Thanked 501 Times in 488 Posts
    try

    Code:
    function zxcBorder(zxcmde,zxcobj,zxctime,zxcsrt,zxcfin,zxcborder,zxcgrp,zxclevel){
     if (typeof(zxcobj)=='string'){ zxcobj=document.getElementById(zxcobj); }
     var zxcevt=window.event||arguments.callee.caller.arguments[0];
     if (!zxcobj.srtfin) zxcobj.srtfin=[zxcsrt,zxcfin];
     var zxcoop=zxcobj[zxcmde.replace('-','')+'oop'];
     if (!zxcoop) zxcAnimator(zxcmde,zxcobj,zxcsrt,zxcfin,'sin',zxctime,zxcborder);
     else if (zxcobj.srtfin) zxcAnimator(zxcmde,zxcobj,(zxcobj.srtfin[0].match('#'))?zxcRGBtoHex(zxcoop.data[2][0],zxcoop.data[2][1],zxcoop.data[2][2]):zxcoop.data[2],(zxcevt.type=='mouseout')?zxcobj.srtfin[0]:zxcobj.srtfin[1],'sin',zxctime)
     else return;
    // section for use with div toggle
     if (zxcevt.type=='click'&&zxcgrp){
      if (!zxcTBAry[zxcgrp]) zxcTBAry[zxcgrp]=[];
      for (var zxc0=0;zxc0<zxcTBAry[zxcgrp].length;zxc0++){
       if (zxcTBAry[zxcgrp][zxc0][0]==zxcobj) zxcTBAry[zxcgrp].splice(zxc0,1);
      }
      zxcTBAry[zxcgrp].push([zxcobj,zxclevel]);
      for (var zxc0=1;zxc0<zxcTBAry.length;zxc0++){
       if (zxcTBAry[zxc0]){
        for (var zxc0a=0;zxc0a<zxcTBAry[zxc0].length;zxc0a++){
         if (zxc0!=zxcgrp||(zxcTBAry[zxc0][zxc0a][1]>=zxclevel&&zxcTBAry[zxc0][zxc0a][0]!=zxcobj)){
          var zxcnobj=zxcTBAry[zxc0][zxc0a][0];
          var zxcoop=zxcnobj[zxcmde.replace('-','')+'oop'];
          zxcAnimator(zxcmde,zxcnobj,(zxcnobj.srtfin[0].match('#'))?zxcRGBtoHex(zxcoop.data[2][0],zxcoop.data[2][1],zxcoop.data[2][2]):zxcoop.data[2],zxcsrt,'sin',zxctime)
         }
        }
       }
      }
     }
    // end section for use with div toggle
    }
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/

  • #3
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,505
    Thanks
    3
    Thanked 501 Times in 488 Posts
    The script was designed for same srt fin for border top and bottom

    now for different colors

    Code:
    function zxcBorder(zxcmde,zxcobj,zxctime,zxcsrt,zxcfin,zxcborder,zxcgrp,zxclevel){
     if (typeof(zxcobj)=='string'){ zxcobj=document.getElementById(zxcobj); }
     var zxcevt=window.event||arguments.callee.caller.arguments[0];
     if (zxcevt.type!='click'){
      if (!zxcobj.srtfin) zxcobj.srtfin=[zxcsrt,zxcfin];
      var zxcoop=zxcobj[zxcmde.replace('-','')+'oop'];
      if (!zxcoop) zxcAnimator(zxcmde,zxcobj,zxcsrt,zxcfin,'sin',zxctime,zxcborder);
      else if (zxcobj.srtfin) zxcAnimator(zxcmde,zxcobj,(zxcobj.srtfin[0].match('#'))?zxcRGBtoHex(zxcoop.data[2][0],zxcoop.data[2][1],zxcoop.data[2][2]):zxcoop.data[2],(zxcevt.type=='mouseout')?zxcobj.srtfin[0]:zxcobj.srtfin[1],'sin',zxctime)
     }
    // section for use with div toggle
     if (zxcevt.type=='click'&&zxcgrp){
      if (!zxcobj.srtfin1) zxcobj.srtfin1=[zxcsrt,zxcfin];
      var zxcoop=zxcobj[zxcmde.replace('-','')+'oop'];
      if (!zxcoop) zxcAnimator(zxcmde,zxcobj,zxcsrt,zxcfin,'sin',zxctime,zxcborder);
      else if (zxcobj.srtfin1) zxcAnimator(zxcmde,zxcobj,(zxcobj.srtfin1[0].match('#'))?zxcRGBtoHex(zxcoop.data[2][0],zxcoop.data[2][1],zxcoop.data[2][2]):zxcoop.data[2],(zxcevt.type=='mouseout')?zxcobj.srtfin1[0]:zxcobj.srtfin1[1],'sin',zxctime)
      else return;
      if (!zxcTBAry[zxcgrp]) zxcTBAry[zxcgrp]=[];
      for (var zxc0=0;zxc0<zxcTBAry[zxcgrp].length;zxc0++){
       if (zxcTBAry[zxcgrp][zxc0][0]==zxcobj) zxcTBAry[zxcgrp].splice(zxc0,1);
      }
      zxcTBAry[zxcgrp].push([zxcobj,zxclevel]);
      for (var zxc0=1;zxc0<zxcTBAry.length;zxc0++){
       if (zxcTBAry[zxc0]){
        for (var zxc0a=0;zxc0a<zxcTBAry[zxc0].length;zxc0a++){
         if (zxc0!=zxcgrp||(zxcTBAry[zxc0][zxc0a][1]>=zxclevel&&zxcTBAry[zxc0][zxc0a][0]!=zxcobj)){
          var zxcnobj=zxcTBAry[zxc0][zxc0a][0];
          var zxcoop=zxcnobj[zxcmde.replace('-','')+'oop'];
    //      zxcAnimator(zxcmde,zxcnobj,(zxcnobj.srtfin[0].match('#'))?zxcRGBtoHex(zxcoop.data[2][0],zxcoop.data[2][1],zxcoop.data[2][2]):zxcoop.data[2],zxcsrt,'sin',zxctime)
          zxcAnimator(zxcmde,zxcnobj,(zxcnobj.srtfin[0].match('#'))?zxcRGBtoHex(zxcoop.data[2][0],zxcoop.data[2][1],zxcoop.data[2][2]):zxcoop.data[2],zxcsrt,'sin',zxctime)
         }
        }
       }
      }
     }
    // end section for use with div toggle
    }
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/

  • #4
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    Hey Vic

    The modification for the color works like a charm, and I'm now implementing it on all of my links The modification for preventing the error doesn't seem to have worked... could it be that this is because the element to which the script is being applied exists on the page during a 'reload' or 'new page loading', but the script hasn't been initialized yet?

    Would applying a watchdog to every page work? the onmouseover script could call the watchdog, which would verify if the script has loaded yet and if not wait until it had to call it. It's just an idea, and I know it's a bit of a roundabout way of doing things, but it might work

    oh, i noticed you commented out
    Code:
    //      zxcAnimator(zxcmde,zxcnobj,(zxcnobj.srtfin[0].match('#'))?zxcRGBtoHex(zxcoop.data[2][0],zxcoop.data[2][1],zxcoop.data[2][2]):zxcoop.data[2],zxcsrt,'sin',zxctime)
          zxcAnimator(zxcmde,zxcnobj,(zxcnobj.srtfin[0].match('#'))?zxcRGBtoHex(zxcoop.data[2][0],zxcoop.data[2][1],zxcoop.data[2][2]):zxcoop.data[2],zxcsrt,'sin',zxctime)
    I was wondering what the use of it was?
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #5
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,505
    Thanks
    3
    Thanked 501 Times in 488 Posts
    I am having trouble simulation this but

    move zxcInitBorderGrp('pageHolder','border-Bottom','A',1000,2000,'#FFFFFF','#000000','solid #000000 1px');

    from the pageHolder div mouseover to the <BODY> on load and

    Code:
    function zxcBorder(zxcmde,zxcobj,zxctime,zxcsrt,zxcfin,zxcborder,zxcgrp,zxclevel){
     if (typeof(zxcobj)=='string'){ zxcobj=document.getElementById(zxcobj); }
     var zxcevt=window.event||arguments.callee.caller.arguments[0];
     if (zxcevt.type!='click'){
      if (!zxcobj.srtfin) zxcobj.srtfin=[zxcsrt,zxcfin];
      var zxcoop=zxcobj[zxcmde.replace('-','')+'oop'];
      if (!zxcoop) zxcAnimator(zxcmde,zxcobj,zxcsrt,zxcfin,'sin',zxctime,zxcborder);
      else if (zxcoop.data) zxcAnimator(zxcmde,zxcobj,(zxcobj.srtfin[0].match('#'))?zxcRGBtoHex(zxcoop.data[2][0],zxcoop.data[2][1],zxcoop.data[2][2]):zxcoop.data[2],(zxcevt.type=='mouseout')?zxcobj.srtfin[0]:zxcobj.srtfin[1],'sin',zxctime);
     }
    // section for use with div toggle
     if (zxcevt.type=='click'&&zxcgrp){
      if (!zxcobj.srtfin1) zxcobj.srtfin1=[zxcsrt,zxcfin];
      var zxcoop=zxcobj[zxcmde.replace('-','')+'oop'];
      if (!zxcoop) zxcAnimator(zxcmde,zxcobj,zxcsrt,zxcfin,'sin',zxctime,zxcborder);
      else if (zxcobj.srtfin1) zxcAnimator(zxcmde,zxcobj,(zxcobj.srtfin1[0].match('#'))?zxcRGBtoHex(zxcoop.data[2][0],zxcoop.data[2][1],zxcoop.data[2][2]):zxcoop.data[2],(zxcevt.type=='mouseout')?zxcobj.srtfin1[0]:zxcobj.srtfin1[1],'sin',zxctime)
      else return;
      if (!zxcTBAry[zxcgrp]) zxcTBAry[zxcgrp]=[];
      for (var zxc0=0;zxc0<zxcTBAry[zxcgrp].length;zxc0++){
       if (zxcTBAry[zxcgrp][zxc0][0]==zxcobj) zxcTBAry[zxcgrp].splice(zxc0,1);
      }
      zxcTBAry[zxcgrp].push([zxcobj,zxclevel]);
      for (var zxc0=1;zxc0<zxcTBAry.length;zxc0++){
       if (zxcTBAry[zxc0]){
        for (var zxc0a=0;zxc0a<zxcTBAry[zxc0].length;zxc0a++){
         if (zxc0!=zxcgrp||(zxcTBAry[zxc0][zxc0a][1]>=zxclevel&&zxcTBAry[zxc0][zxc0a][0]!=zxcobj)){
          var zxcnobj=zxcTBAry[zxc0][zxc0a][0];
          var zxcoop=zxcnobj[zxcmde.replace('-','')+'oop'];
          zxcAnimator(zxcmde,zxcnobj,(zxcnobj.srtfin[0].match('#'))?zxcRGBtoHex(zxcoop.data[2][0],zxcoop.data[2][1],zxcoop.data[2][2]):zxcoop.data[2],zxcsrt,'sin',zxctime)
         }
        }
       }
      }
     }
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/

  • #6
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    I'll test it out now, thanks Vic.

    I am able to simulate it by putting my mouse over a text-link and then hit F5, which causes the page to refresh. right after I hit F5 i wiggle my mouse over and off the link and it produces the error almost every time.

    Is there any way to code in an exclusion criteria into the onload call, or even into the script to say

    "if class = zxcNOBORDER then do not apply the script to elements in this div"?

    because pageHolder contains the entire page, so every link in it will have this applied to it (which is what I want, with a few exceptions)
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #7
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    Perfect Vic, the move to onload worked like a charm! (so far, i have to leave in 10 minutes so may not be able to test it 100%, but it looks like its working!

    can we apply the same logic to the links_BW fades? I ask because if you click on any of the B&W vertical images they no longer fade out and stay that way like they used to because the page is being reloaded every time.
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #8
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,505
    Thanks
    3
    Thanked 501 Times in 488 Posts
    Code:
    function zxcInitBorderGrp(zxcid,zxcmde,zxctag,zxctimeover,zxctimeout,zxcsrt,zxcfin,zxcborder){
     var zxcp=document.getElementById(zxcid);
     var zxcels=document.getElementById(zxcid).getElementsByTagName(zxctag);
     for (var zxc0=0;zxc0<zxcels.length;zxc0++){
      if (zxcels[zxc0].className&&zxcels[zxc0].className.match('zxcFB')){
       zxcels[zxc0].onmouseover=function(){ zxcBorder(zxcmde,this,zxctimeover,zxcsrt,zxcfin,zxcborder); }
       zxcels[zxc0].onmouseout=function(){ zxcBorder(zxcmde,this,zxctimeout,zxcfin,zxcsrt); }
      }
     }
     zxcp.onmouseover=null;
    }
    
    
    	<div id="linksMedical">
    		<a href="#servicesMedical" class=" zxcFB" onclick="zxcToggle('servicesMedical',1,0); zxcBorder('border-Left',this,1000,'#FFFFFF','#0000A0','solid white 1px',1,0); return false;">Medical Services</a>
    		<a href="#clinicsMedical" class=" zxcFB" onclick="zxcToggle('clinicsMedical',2,0); zxcBorder('border-Left',this,1000,'#FFFFFF','#0000A0','solid #0000A0 1px',2,0); return false">Clinics</a>
    		<a href="#workshopsMedical" class=" zxcFB" onclick="zxcToggle('workshopsMedical',3,0); zxcBorder('border-Left',this,1000,'#FFFFFF','#0000A0','solid #0000A0 1px',3,0); return false">Workshops</a>
    		<a href="#calendarMedical" class=" zxcFB" onclick="zxcToggle('calendarMedical',4,0); zxcBorder('border-Left',this,1000,'#FFFFFF','#0000A0','solid #0000A0 1px',4,0); return false">Calendar</a>
    	</div>
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/

  • #9
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,505
    Thanks
    3
    Thanked 501 Times in 488 Posts
    can we apply the same logic to the links_BW fades? I ask because if you click on any of the B&W vertical images they no longer fade out and stay that way like they used to because the page is being reloaded every time.
    __________________
    can you make absolutely sure that the cookie method meets the requirement before I put more work into this
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/


  •  

    Posting Permissions

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