SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Evangelist Azam.net's Avatar
    Join Date
    Apr 2002
    Location
    UK
    Posts
    479
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Question DHTML stops javascript from working - help please

    I am using this javascript to slide-in some text from the side of the screen on my webpages e.g. the gif image which says 'Reviews' at the top of this page.

    I am trying to use DHTML scripts to create pop-ups because more and more people are using pop-up killers; I have heard that such DHTML pop-ups are not blocked by these pop-up killers.

    The scripts work fine on pages without the javascript I mentioned above, but when I use them on pages with the script, it shows the DHTML pop-up but not the image sliding in from the side of the browser. An example is on this test page.

    I have tried to use various DHTML scripts, but they all disable my slide-in javascript. Ones I've used include this, this and this.

    Is there a reason why the slide-in javascript doesn't work when I add DHTML pop-ups?

    How can I resolve this issue please?

    Thank you.
    Last edited by Azam.net; Nov 17, 2003 at 14:53.
    Azam Marketing, Inc.
    Award-Winning Digital Marketing and Design Results Since 1997
    Click here to read acclaimed online marketing & design blog

  2. #2
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your 'this test page' doesn't have all the scripts it needs. It doesn't have any of the MM_ functions.

    Have a look at
    Tips for solving onload conflicts

  3. #3
    SitePoint Evangelist Azam.net's Avatar
    Join Date
    Apr 2002
    Location
    UK
    Posts
    479
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much for the link. I have looked through the advice on the page you referred me to and I think the problem could be the onload command. It is within the pop-up code:

    <!-- DHTML Pop-Up Advertising Code Begin -->
    ...
    window.onload=initbox
    ...
    <!-- DHTML Pop-Up Advertising Code End -->

    Like I said, the Javascript slide-in works perfectly without the DHTML Pop-up code, so that must be the problem. Only thing is, how do I solve it?

    Very sorry, but I'm not that knowledgeable about JS/DHTML - need help from some of you experts.

    Thank you.
    Azam Marketing, Inc.
    Award-Winning Digital Marketing and Design Results Since 1997
    Click here to read acclaimed online marketing & design blog

  4. #4
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Nadeem,

    When I try to get "/images/sidezoom.js" I get redirected to litmania.com. I also notice that you're hot-linking to litmania.com for "linkfader.js". I don't know anything about litmania - do you have their permission to hotlink to their js files? (hot-linking is a real pet-peeve of mine ) I'll proceed as if you do have their permission - but if you don't please resolve this issue.

    I don't know what's in sidezoom.js nor linkfader.js, but it sounds like you've searched those files for "onload" and found "window.onload=initbox".

    Now, for the page at this url: "http://www.ukhotmovies.com/reviews/kill-bill-1/", you noticed that there's an onload conflict. I'm going to follow the steps outlined in the 'onload conflict' article:

    1) Take the onload code out of the body tag and put it into a custom onload listener (which I've named 'windowOnload').

    Now the opening body tag looks like this:
    Code:
    <body TEXT="black" background="/movback.gif">
    Now windowOnload looks like the following. Note that I consolidated the args in the call to MM_preloadImages.
    Code:
    function windowOnload()
    {
      dynAnimation();
      popUp('equitalk.html');
      MM_preloadImages('/images/item9.jpg','#923495515812',
        '/images/item10.jpg','#923497831359',
        '/images/item11.jpg','#923497846203',
        '/images/item12.gif','#923497851953',
        '/images/item13.jpg','#923497858375',
        '/images/item14.jpg','#923497865375',
        '/images/item15.jpg','#923497871484',
        '/images/item16.gif','#923497879015');
    
    }
    2) Delete the line "window.onload=initbox" from the js file in which you found it and call initbox in windowOnload. Our onload listener now looks like:
    Code:
    function windowOnload()
    {
      initbox();
      dynAnimation();
      popUp('equitalk.html');
      MM_preloadImages('/images/item9.jpg','#923495515812',
        '/images/item10.jpg','#923497831359',
        '/images/item11.jpg','#923497846203',
        '/images/item12.gif','#923497851953',
        '/images/item13.jpg','#923497858375',
        '/images/item14.jpg','#923497865375',
        '/images/item15.jpg','#923497871484',
        '/images/item16.gif','#923497879015');
    
    }
    If "window.onload=initbox" is the only assignment to onload that you found in the js files, then we are done

  5. #5
    SitePoint Evangelist Azam.net's Avatar
    Join Date
    Apr 2002
    Location
    UK
    Posts
    479
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Just thought I should provide you with a progress report:

    Thanks a million for your advice. I spent a while fiddling around with the scripts and had problems getting them going, even with your very clearly-laid out help, but have finally managed to get them to work.

    Thank you very much Mike

    BTW, litmania.com is my own site. UKHotMovies.com is actually hosted at http://www.litmania.com/bla . I know what you mean about hotlinking - I despise it too.
    Azam Marketing, Inc.
    Award-Winning Digital Marketing and Design Results Since 1997
    Click here to read acclaimed online marketing & design blog

  6. #6
    SitePoint Evangelist Azam.net's Avatar
    Join Date
    Apr 2002
    Location
    UK
    Posts
    479
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Two more points:

    (1) Anybody got a pop-up killer installed? Do you see the drop-in box on the following page? Can you click on the ad and go the relevant page OK?:

    http://www.ukhotmovies.com/reviews/kill-bill-1/

    (2) How would I add a thin black border to the DHTML drop-in code? I have tried various permutations of the border command to no avail. Here's the line I need to add to:

    <div id="dropin" style="position:absolute;visibility:hidden;left:350px;top:500px;width:328px;height:275px;background-color:#1D418B;">

    Thanks.
    Azam Marketing, Inc.
    Award-Winning Digital Marketing and Design Results Since 1997
    Click here to read acclaimed online marketing & design blog


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
  •