Jump to content

Flyover popup works correctly but posts undefined error message


lisounder

Recommended Posts

This script displays a flyover box in the viewable browser screen, moving the flyover box either up or down to ensure visibility.  It functions correctly, however, the line      if (new_pos.top != old_pos.top)  posts  SCRIPT5007: 'undefined' is null or not an object error in Explorer 8 and 9.  Any suggestions appreciated.

 

Thanks.

 

var count_login = 0;

var count_hook = 0;

 

var timer_nf;

 

var old_pos;

var new_pos;

var new_top_pos;

 

 

function flyover_user_disp(user)

{

timer_nf = setTimeout(function() {

showtip(user); },

            600);

}

 

function flyover_user_h(user)

{

clearTimeout(timer_nf);

        new_pos = $("#"+user).offset();

 

        if (new_pos.top != old_pos.top)  :confused:

        {

$("#"+user).animate({top: old_pos.top}, 'fast');

        }

 

        flyover_user_hide();

}

 

function getBodyScrollTop()

{

  return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);

}

 

        function showtip(user)

        {

 

            $(".user-profile-popup").hide('fast');

            var html = document.documentElement;

 

            $("#"+user).show();

 

            var br=document.getElementById(user).getBoundingClientRect();

           

            old_pos = $("#"+user).offset();

            new_top_pos = old_pos.top;

           

            if (br.bottom > html.clientHeight)

            {

                new_top_pos = old_pos.top - $("#"+user).height() - 95;

                $("#"+user).animate({top: new_top_pos}, 'fast');

            }

 

            $("#"+user).hide();

 

            $("#"+user).animate({opacity: "show", left: br.left, top: new_top_pos}, 'fast');

        }

 

function slide()

    {

    if(count_login == parseInt(user_Info.length)-1) {

          count_login=0;

  $("#feat_member").html("<h3><span>Featured Member</span></h3>"+user_Info[count_login]);

        }

        else {

            count_login++;

$("#feat_member").html("<h3><span>Featured Member</span></h3>"+user_Info[count_login]);

        }

    }

 

    setInterval("slide()",10000);

function chage_hook()

{

    if(count_hook == parseInt(hookup.length)-1) {

            count_hook = 0;

        }

        else {

            count_hook += 1;

        }

        $("#hook_up_alert").html(hookup[count_hook]);

}

    setInterval("chage_hook()",15000);

 

 

[attachment deleted by admin]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.