Simple example showing how to use Opentip with Requirejs. Obs.: with retina support
A Pen by Thiago Lagden on CodePen.
Simple example showing how to use Opentip with Requirejs. Obs.: with retina support
A Pen by Thiago Lagden on CodePen.
h1 Example Opentip with RequireJs | |
p Click on red box. | |
#example |
requirejs.config | |
baseUrl: "js/lib" | |
paths: | |
opentip: "//rawgit.com/lagden/opentip/compile/lib/opentip" | |
"opentip-adapter": "//rawgit.com/lagden/opentip/compile/lib/adapter-native" | |
require ["tooltip"], (Tooltip) -> | |
el = document.querySelector("#example") | |
new Tooltip(el, "Awesome!!") | |
return | |
define "tooltip", [ | |
"require" | |
"opentip" | |
"opentip-adapter" | |
], (req, Opentip, Adapter) -> | |
# Tooltip setup | |
Tooltip = (el, txt) -> | |
new Opentip(el, txt, | |
style: "example" | |
) | |
return | |
"use strict" | |
Opentip.styles.example = | |
showOn: "click" | |
tipJoint: "top" | |
target: true | |
fixed: true | |
hideTrigger: "closeButton" | |
Tooltip |
@import "compass" | |
#example | |
background-color: red | |
width: 20px | |
height: 20px | |
display: block | |
cursor: pointer |