Problem with Adsense and event binding and a design issue

Request help with using Avant Browser here.

Moderators: Support Staff², Support Staff, AvantGuard, Developer

Post Reply
DeloraDrosick
Newbie
Newbie
Posts: 2
Joined: Mon Oct 31, 2016 1:53 pm
Windows Version: Windows 8 64o-bit
Avant Version: 2016 build 10
Default engine: Webkit
IE Version: 11.0.35
Skin: Orange Sickle

Problem with Adsense and event binding and a design issue

Post by DeloraDrosick » Tue Nov 01, 2016 6:31 am

I develop websites for multiple platforms i.e. front end developer & designer. So, it is my job to test codes on multiple browsers too. I am trying to have event binding keys for my arrows keys at my website page on avant browser. I do the binding correctly, by the time page loads but all the binding finished, as the Adsense advertisement is loaded on the website page. Only directory pages are having this issue, which consists half of the whole site pages.

While pressing the arrow keys repeatedly, while the page is loaded. I am able to bound the click event successfully before the Ad appears. After the Ad is loaded, event stopped working entirely. The page started scrolling on continuously pressing the key; this is the default function for this case. It should not happen, as I have unable the defaults function using:

Code: Select all

window.onkeydown = function(keys) {
    // I am seeking space bar & up,down,left,right keys
    if (keys.keyCode == 32 || keys.keyCode == 37 || keys.keyCode == 38 || keys.keyCode == 39 || keys.keyCode == 40) 
    {
        keys.preventDefault();
        return false;
    }
};
I am thinking about issues with ad, as it is loading after everything. It is 'stealing the focus' from another area of the page. But it is only happening in the avant browser. I am using Mousetrap to accomplish this task. I am clearly sure; everything is okay with mousetrap. As, the issue is avant browser and only occurring, when the ad is loaded. Can you tell, if I am missing something on my end in code, which could cause this problem and also, how can I stop the advertisement to stop depending on the user cursor movement. And perform as required.

Solution tried:
I have failed, while trying adding these lines of code:

Code: Select all

adsLoader.addEventListener(AdsLoadedEvent.ADS_LOADED, function(){ if ( document.activeElement ) { document.activeElement.blur(); } }, false);
I got this line of code from official docs. It allows the focus to return from ads to the body of the page.

Problem #2:
At the same time, another issue is encountering. My client website contains pages of many US bases in the entire world. All the pages are working fine on Avant browser. Other than North-East region pages. There are 2 maps on every page of the directory. The main map is showing the location on the big US map, and this map is at the top of the page. And another map is at the end of the article; it will show the zoomed version of the same map. But this map is continuously coming distorted with roman or greek text. http://militarybases.co/directory/nswc- ... hlgren-va/ is one of the problematic pages, I have removed the map for the sake of better visualization. I will be thankful if you could see into H of the page.

Post Reply