0
Welcome Guest! Login
0 items Join Now

javascript conflict with Stoppress and Litebox

  • javascript conflict with Stoppress and Litebox

    Posted 17 years 9 months ago
    • I'm using Stop Press' "DHTML Box" with a bento tempalte and the javascript is conflicting with litebox. http://extensions.joomla.org/component/option,com_mtree/task,viewlink/link_id,770/Itemid,35/

      When the DHTML banner is active and you click on a litebox thumbnail the image does not load with the cool litebox effects. http://www.wcso.org

      Can someone familiar with Javascript look at the Stop press code to see where the conflict could be coming from?



      The Stop Press DHTML javascript is:
      // JavaScript Document
       
       
      //Specify rate of display (1/freq)
      var freq=1
       
      var random_num=Math.floor(Math.random()*freq)
      if (random_num==0)
      window.onload=initbox
      var ie=document.all
      var dom=document.getElementById
      var ns4=document.layers
      var calunits=document.layers? "" : "px"
       
      var bouncelimit=32 //(must be divisible by 8)
      var direction="up"
       
      function initbox(){
      if (!dom&&!ie&&!ns4)
      return
       
      cookie = readCookie("stop_press");
      if (cookie == 1) {
           return
      } else {
           createCookie("stop_press", "1");
      }
       
      crossobj=(dom)?document.getElementById("dropin").style : ie? 
      document.all.dropin : document.dropin
      scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
      crossobj.top=scroll_top-250+calunits
      crossobj.visibility=(dom||ie)? "visible" : "show"
      dropstart=setInterval("dropin()",50)
      }
       
      function createCookie(name,value,hours) {
        if (hours) {
          var date = new Date();
          date.setTime(date.getTime()+(hours*60*60));
          var expires = "; expires="+date.toGMTString();
        }
        else expires = "";
        document.cookie = name+"="+value+expires+"; path=/";
      }
       
      function readCookie(name) {
        var nameEQ = name + "=";
        var ca = document.cookie.split(';');
      &nbsp; for(var i=0;i < ca.length;i++) {
      &nbsp; &nbsp; var c = ca[i];
      &nbsp; &nbsp; while (c.charAt(0)==' ') c = c.substring(1,c.length);
      &nbsp; &nbsp; if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
      &nbsp; }
      &nbsp; return null;
      }
       
      function dropin(){
      scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
      if (parseInt(crossobj.top)<100+scroll_top)
      crossobj.top=parseInt(crossobj.top)+40+calunits
      else{
      clearInterval(dropstart)
      bouncestart=setInterval("bouncein()",50)
      }
      }
       
      function bouncein(){
      crossobj.top=parseInt(crossobj.top)-bouncelimit+calunits
      if (bouncelimit<0)
      bouncelimit+=8
      bouncelimit=bouncelimit*-1
      if (bouncelimit==0){
      clearInterval(bouncestart)
      }
      }
       
      function dismissbox(){
      if (window.bouncestart) clearInterval(bouncestart)
      crossobj.visibility="hidden"
      }
       
      function truebody(){
      return (document.compatMode && 
      document.compatMode!="BackCompat")? document.documentElement : document.body
      }

Time to create page: 0.043 seconds