JQuery symmetric arrow and jquery arrow

Source: Internet
Author: User

JQuery symmetric arrow and jquery arrow

For details, refer to my article: jQuery pop-up layer + CSS arrow creation.

The usage is as follows:

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Specific implementation code:

/*** Jquery arrow generation * @ author: xuzengqiang * @ since: 15:31:39 **/; (function ($) {jQuery. fn. extend ({/*** Description: generate the specified arrow style **/arrow: function (options) {var defaultOptions = {color: '# afaf', height: 20, width: 20, // direction: ['up', 'bottom ', 'left', 'right'] direction: 'top '}; var settings = jQuery. extend (defaultOptions, options | {}), current = $ (this); function loadStyle(){current.css ({"display": "block", "width": "0 ", "height": "0"}); if (settings. direction = "top" | settings. direction = "bottom") returns current.css ({"border-left-width": settings. width/2, "border-right-width": settings. width/2, "border-left-style": "solid", "border-right-style": "solid", "border-left-color": "transparent ", "border-right-color": "transparent"}); if (settings. direction = "top") Export current.css ({"border-bottom-width": settings. height, "border-bottom-style": "solid", "border-bottom-color": settings. color}) ;}else response current.css ({"border-top-width": settings. height, "border-top-style": "solid", "border-top-color": settings. color}) ;}} else if (settings. direction = "left" | settings. direction = "right") returns current.css ({"border-top-width": settings. height/2, "border-bottom-width": settings. height/2, "border-top-style": "solid", "border-bottom-style": "solid", "border-top-color": "transparent ", "border-bottom-color": "transparent"}); if (settings. direction = "left") returns current.css ({"border-right-width": settings. width, "border-right-style": "solid", "border-right-color": settings. color}) ;}else response current.css ({"border-left-width": settings. width, "border-left-style": "solid", "border-left-color": settings. color}) ;}} return this. each (function () {loadStyle () ;}}) ;}) (jQuery );



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.