Skip to content

Instantly share code, notes, and snippets.

@lagden
Created April 16, 2014 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lagden/10936019 to your computer and use it in GitHub Desktop.
Save lagden/10936019 to your computer and use it in GitHub Desktop.
A Pen by Thiago Lagden.

Example Opentip with Requirejs

Simple example showing how to use Opentip with Requirejs. Obs.: with retina support

A Pen by Thiago Lagden on CodePen.

License.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment