diff --git a/example.html b/example.html deleted file mode 100644 index f8445a3..0000000 --- a/example.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - -
-

test adsgdsgds

-
- -
- - - - - - - - - - - - \ No newline at end of file diff --git a/example/css/bootstrap-magic-button.css b/example/css/bootstrap-magic-button.css new file mode 100644 index 0000000..84edbf3 --- /dev/null +++ b/example/css/bootstrap-magic-button.css @@ -0,0 +1,21 @@ +button[class^=magicBtn] { + display: none; + position: absolute; + border-style: none; + background: none; + background-repeat: no-repeat; + width: 47px; + height: 32px; + opacity: 0.7; +} + +button[class*="magicBtn-active"] { + position: absolute; + border-style: none; + background: none; + background-repeat: no-repeat; + width: 47px; + height: 32px; + opacity: 1; +} + diff --git a/example/example.css b/example/example.css index a7abbcc..f55f6a4 100644 --- a/example/example.css +++ b/example/example.css @@ -2,8 +2,8 @@ button[class^="magicBtn hero"] { margin-top: 80px; } -footer .footer { - style="margin-top: 45; +.footer { + margin-top: 45px; padding:35px 0 36px; border-top: 1px solid #E5E5E5; } \ No newline at end of file diff --git a/example/img/msg.png b/example/img/msg.png new file mode 100644 index 0000000..947eeb8 Binary files /dev/null and b/example/img/msg.png differ diff --git a/example/img/pin-off.png b/example/img/pin-off.png new file mode 100644 index 0000000..98f0028 Binary files /dev/null and b/example/img/pin-off.png differ diff --git a/example/img/pin-on.png b/example/img/pin-on.png new file mode 100644 index 0000000..12fd79a Binary files /dev/null and b/example/img/pin-on.png differ diff --git a/example/index.html b/example/index.html index 491f108..39eefd7 100644 --- a/example/index.html +++ b/example/index.html @@ -9,7 +9,7 @@ - + @@ -42,6 +42,8 @@ @@ -88,7 +90,7 @@

This is the most basic magic button, the default behavior is to stick on the right side of div which is containing magic buttons

- @@ -98,7 +100,7 @@


-
<div class="well span3">
  <p>This is the most basic magic button, ...</p>

  <button class="magicBtn" data-image="../img/msg.png"/>
</div>
+
<div class="well span3">
  <p>This is the most basic magic button, ...</p>

  <button class="magicBtn" data-image="img/msg.png"/>
</div>
@@ -112,7 +114,7 @@

Add a toggle effect using the data-toggle="magicBtn"

-
@@ -120,7 +122,7 @@


-
<button class="magicBtn" data-image="../img/msg.png" data-toggle="magicBtn"/>
+
<button class="magicBtn" data-image="img/msg.png" data-toggle="magicBtn"/>
@@ -132,7 +134,7 @@

Usedata-toggle-image to customize toggle image

-
@@ -140,7 +142,7 @@


-
<button class="magicBtn" data-image="../img/pin-off.png" data-toggle="magicBtn" data-toggle-image="../img/pin-on.png"/>
+
<button class="magicBtn" data-image="img/pin-off.png" data-toggle="magicBtn" data-toggle-image="img/pin-on.png"/>
@@ -154,7 +156,7 @@

You can enable a hover effect over your buttons

jquery.hoverIntent is used in replacement of jQuery builtin hover

-
@@ -162,12 +164,89 @@


-
<button class="magicBtn hover" data-image="../img/pin-off.png" data-toggle="magicBtn" data-toggle-image="../img/pin-on.png"/>
+
<button class="magicBtn hover" data-image="img/pin-off.png" data-toggle="magicBtn" data-toggle-image="img/pin-on.png"/>
$('.hover').magicBtn({hover: true});
$('.hover').magicBtn('show');
+
+
+ +

How about bootstrap icons ?

+ +
+
+
+

Just put the icons inside the button

+ + +
+ +
+
+
+
+
<button class="magicBtn icon"><i class="icon-search"></i></button>
<button class="magicBtn icon"><i class="icon-user"></i></button>
+
$('.icon').magicBtn({hover: true, alignement: 'top'});
$('.icon').magicBtn('show');
+
+
+ +
+
+
+

Methods

+

$().magicBtn('show')

+

Shows the buttons found by selector

+
+
+

$().magicBtn('hide')

+

Hides the buttons found by selector

+
+
+

$().magicBtn('toggle')

+

Activates toggle state

+
+

You can enable auto toggling of a button by using data-toggle attribute

+
+
+
+

Options

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nametypedefaultdescription
alignementstringcenterstart showing buttons from center, 1 in middle, even on ones top and odd ones on bottom
betweenSpaceinteger2space between buttons
hoverbooleanfalseEnables hover effect
+
+
+ +