Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding a close button? #13

Open
ibnYusrat opened this issue Feb 26, 2018 · 1 comment
Open

adding a close button? #13

ibnYusrat opened this issue Feb 26, 2018 · 1 comment

Comments

@ibnYusrat
Copy link

What would be the easiest way to add a transparent png close button to the top-right corner?

@ibnYusrat
Copy link
Author

I added a close button by making the following modifications in uglypop.js:

Right below line # 12: that says var overlay_wrapper = document.createElement('div');
I added:

    close_button.id = 'uglipop_close_button';
    close_button.setAttribute('style', 'z-index:999999;position:fixed;right: -7px;top:-7px; cursor:pointer; filter: drop-shadow(5px 5px 5px #222);');
    close_button.innerHTML = "<img src='path/to/close-button.png' />";

And then below line # 25 that says: overlay_wrapper.appendChild(overlay); I added:
content_fixed.appendChild(close_button);

And that was it. I hope someone else finds it useful someday. Don't forget to update path to your close-button PNG.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant