IE7 compatible with After, before methods

Source: Internet
Author: User

1, the first step http://jquery.lukelutman.com/plugins/pseudo/download Jq-pseudo.js download, the introduction of jquery and Jq-pseudo.js2, the writing selector syntax:
selector: Before, selector {
/* Compatible with IE6, ie7*/
Before: ' What to write ';
/* Compatible with ie8*/
Content: ' What to write ';
}to set the style of a pseudo-element:selector: Before, selector. Before {
Writing style
}Demo
1 <!DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd ">2 <HTML>3     <Head>4         <title>Basic example-jquery Pseudo Plugin</title>5         <Scripttype= "Text/javascript"src= "Jquery.js"></Script>6         <Scripttype= "Text/javascript"src= "Jquery.pseudo.js"></Script>7         <Scripttype= "Text/javascript">8             $(function(){9                 $('#on'). Bind ('Click', function(e) {Ten                     $('Body'). addclass ('Toggle'); One E.preventdefault (); A                 }); -                 $('#off'). Bind ('Click', function(e) { -                     $('Body'). Removeclass ('Toggle'); the E.preventdefault (); -                 }); -             }); -         </Script> +         <styletype= "Text/css"> -      + P:before, P{ A before:' foo '; at content:' foo '; } -                  - P:after, P{ -  After:' Bar '; - content:' Bar '; } -          in P:before, p. Before{ - Color:Blue; } to                  + P:after, p. after{ - Color:Red; } the          *         </style> $     </Head>Panax Notoginseng     <Body> -         <H1>Basic example-jquery Pseudo Plugin</H1> the         <P>&laquo; <ahref= "Index.html">Back to the JQuery Pseudo Plugin</a></P> +         <P>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqu A. Ut enim ad minim veniam, quis nostrud exercitation Ullamco laboris nisi Ut aliquip ex ea commodo consequat. Duis aute irure dolor in Reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur Sint Occaecat Cupidatat non proident, sunt in culpa qui officia deserunt mollit anim ID est laborum.</P> A         <P>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqu A. Ut enim ad minim veniam, quis nostrud exercitation Ullamco laboris nisi Ut aliquip ex ea commodo consequat. Duis aute irure dolor in Reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur Sint Occaecat Cupidatat non proident, sunt in culpa qui officia deserunt mollit anim ID est laborum.</P> the         <P>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqu A. Ut enim ad minim veniam, quis nostrud exercitation Ullamco laboris nisi Ut aliquip ex ea commodo consequat. Duis aute irure dolor in Reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur Sint Occaecat Cupidatat non proident, sunt in culpa qui officia deserunt mollit anim ID est laborum.</P> +     </Body> - </HTML>

IE7 compatible with After, before methods

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.