Rising Kaka recently let me more annoying.
In order to remind Taobao buyers in the purchase of automatic goods to avoid being cheated, operators want users to enter the automatic delivery of goods purchase page, you must first read in lightbox form pop-up cheat tips and click OK button to buy the rear. As shown in figure:
Anti-cheat Hint layer default center, if the buyer to visit this page, change the size of the browser window, then the cheat tip layer will recalculate position to stay centered. But installed the rising card of IE Users change browser window, the content of the hint layer suddenly disappeared, and translucent masking layer still exists, because the buyer must click the [OK] button, the shielding layer will disappear. As a result, buyers can only face the gray browser window. Customer service and operations will soon be crawl.
After testing research, rising card is indeed along the Shine of the traditional checkpoint principle. It is estimated that the principle of detection is--as long as the top of the page element, the left style property changes more than three times, it will be considered as floating ads and then the fighter.
On the purchase page of the automatic shipping item, I registered the Window.onresize event to carry on the position control of the cheat hint layer. When the buyer changes the browser window size, the Top,left attribute of the cheat hint layer style is calculated and set up multiple times. So on the rising card in the ambush. The contents of the hint layer are cleared. The [OK] button is also cleared, the buyer cannot click [OK], the masking layer will not disappear, and cannot continue to purchase.
My solution has two:
The first registration ESC keyboard event, even if the content is rising card removal, as long as the buyer press the ESC key, will cancel the prompt. The masking layer will also disappear.
It is clear that this method is unhelpful.
The second is to write additional JavaScript to detect whether the content of the floating layer has changed. Rising card will be considered as a floating advertising layer innerHTML replaced by:
My method is to perform a method to detect whether an element in the layer content is still present after each floating layer is positioned, and if it does not exist, the content is stuck. Then the measures to implement the remedy. Pseudo code is as follows:
<id= "Floatlayer" >
<div id= "InnerObject" >xxx</div>
</div>
<script type= "Text/javascript" >
function SetPosition () {
FloatLayer.style.top = y;
FloatLayer.style.left = x;
settimeout (CHECKKK, 100);
}
function Checkkk () {
if (! InnerObject exists)
Fixup ();
}
</script>
Of course, the best way is to persuade users to cancel the site's advertising screen, but, when will have a good internet?