Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function createArrow() {
- var arrowDown = {
- parent: document.querySelector('.landingItem'),
- div: document.createElement('div'),
- initDiv: function() {
- this.div.classList.add('arrow-down');
- this.div.style.borderLeftWidth = parseInt(document.documentElement.clientWidth)/2 + 'px';
- this.div.style.borderRightWidth = parseInt(document.documentElement.clientWidth)/2 + 'px';
- this.parent.appendChild(this.div);
- },
- checkDiv: function () {
- if(this.parent.querySelector('.arrow-down')) {
- this.parent.removeChild(this.parent.querySelector('.arrow-down'));
- }
- this.initDiv();
- }
- };
- arrowDown.checkDiv();
- .arrow-down {
- margin-top: -2px;
- border-top: 60px solid #501a70;
- border-left: 160px solid transparent;
- border-right: 160px solid transparent;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement