Super Bunny let floating layer disappear the cause and _javascript technique

Source: Internet
Author: User
Tags visibility
Just finished the rising card, and rushed to a super rabbit. But the shooting of the Super Bunny really needs to be improved.

The same problem: the installation of the Super Rabbit IE toolbar users purchase automatic goods, Lightbox form of the purchase reminder box just disappeared. The masking layer of the gray mask still shows that the user cannot continue the operation.

According to the study, the Super rabbit shielding advertising shielding principle more arbitrary, as long as in the JavaScript code similar to "Div.style.position=absolute" code, Div will be hidden, not only that, the Super Rabbit will also check the elements of the page, As long as an element sets the position style attribute in inline as well as any of the matching top/left attributes, such as "<div style=" position:absolute;top:0; >xxx</div>, it will also be hidden.

But unlike the rising card, the Super Bunny does not erase the absolute positioning element from the DOM. Instead, set the element's style.visibility = hidden. This is why the Purchase reminder box for automatic shipping disappears.

How to avoid the Super rabbit gun blind shooting? In fact, it is very simple, do not use JavaScript or in the form of inline to set absolute location-related CSS properties. These CSS properties can be defined directly by class or ID in a stylesheet file or in <style/> (should have done so).

If you have to use JavaScript to set absolute positioning properties, such as the effects of some menu/animation. will be through the script method to solve, remember the Super rabbit and rising card for floating advertising processing difference? The pseudo code may be as follows:

Copy Code code as follows:

<script type= "Text/javascript" >
function SetPosition () {
FloatLayer.style.top = y;
FloatLayer.style.left = x;
settimeout (CHECKSR, 100);
}
function Checksr () {
if (floatlayer.currentstyle && floatlayer.currentstyle.visibility== ' hidden '))
Fixup ();
}
</script>


I also hate floating ads, but Taobao's page is really clean, isn't it

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.