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 2 of 2
  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question JavaScript: Is it possible to stop a javascript function w/ other javascript code?

    Hello ppl!

    Can anyone help me out with this question?

    Is it possible to block/stop a javascript function w/ other javascript command? How?

    I got the following javascript code (it's an auto-adbox that apears - before the pages' <html> tag - every time the page w/ the code is loaded). I'd like to block/stop this code w/ other javascript code in the same page. Is it possible?

    Ps.: Unfortunetly I can't erase/delete the "auto-adbox code" due to function reasons.

    The "auto-adbox" code:

    <HEAD>
    <style type="text/css">
    #adsbox{
    position:absolute;
    align: center;
    left: 0;
    top: -600px;
    padding: 1px;
    z-index: 100;
    visibility:hidden;
    }
    </style>
    <script type="text/javascript"><!--
    var delay__time = 25;

    function showadsbox()
    {
    var ie=document.all && !window.opera;
    var dom=document.getElementById;
    iebody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body;
    objref=(dom)? document.getElementById("adsbox") : document.all.adsbox;
    var docwidth=(ie)? iebody.clientWidth : window.innerWidth;
    docheight=(ie)? iebody.clientHeight: window.innerHeight;
    var objwidth=objref.offsetWidth;
    objheight=objref.offsetHeight;
    objref.style.left=docwidth/2-objwidth/2+"px";
    objref.style.top= document.body.clientHeight -110;
    if (objref.filters)
    {
    objref.filters[0].duration=0.8;
    objref.filters[0].Apply();
    objref.filters[0].Play();
    }
    objref.style.visibility="visible";
    if (objref.style.MozOpacity) mozfadevar=setInterval("mozfadeads()", 90);
    else setTimeout("hideadsbox()", (objref.filters)? (delay__time+objref.filters[0].duration)*1000 : delay__time*1000);
    }

    function mozfadeads()
    {
    if (parseFloat(objref.style.MozOpacity)<1) objref.style.MozOpacity=parseFloat(objref.style.MozOpacity)+0.5;
    else
    {
    clearInterval(mozfadevar);
    setTimeout("hideadsbox()", (objref.filters)? (delay__time+objref.filters[0].duration)*1000 : delay__time*1000);
    }
    }

    // please NOTE function names and variables change every few months!
    // Making it NOT worth your efforts to hack this script!! Sorry.
    function hideadsbox()
    {
    objref.style.visibility="hidden";
    }

    function initads()
    {
    setTimeout("showadsbox()", 100);
    }
    if (window.addEventListener) window.addEventListener("load", initads, false);
    else if (window.attachEvent) window.attachEvent("onload", initads);
    else if (document.getElementById) window.onload=initads;
    // --></script>

    <html>
    ...then starts the page source code...

    Any help is welcome!

  • #2
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    If your host puts an advertisement on your page, then you are most probably legally required to not circumvent it. We will not aid in this, it's against forum rules.


  •  

    Posting Permissions

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