http://www.skuare.net/2011/10/javascriptmouseinfobox_plugin.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | <script> $( function (){ $( '.chill' ).infoBox({ animation: [ 'opacity' , 'bottom' ], useMouse: false, offsetX: 100, offsetY: 0 }); $( '.tool' ).infoBox({ animation: [ 'opacity' , 'bottom' ], offsetX: -20, offsetY: -20, bottomPos: true }); $( '.cate_box' ).infoBox({ animation: [ 'opacity' , 'bottom' ], offsetX: -20, offsetY: -20, bottomPos: true }); }); </script> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | < div class = "main_menu" > < ul > < li > < a href = "#" class = "chill" title = "デコレーション" >Decoration</ a > < ul class = "drop_down" > < li class = "chill" title = "ペーパーポンポン" >< a href = "#" >Pom Poms</ a ></ li > < li class = "chill" title = "ペーパーランタン" >< a href = "#" >Paper lantern</ a ></ li > < li class = "chill" title = "ガーランド" >< a href = "#" >Garlands</ a ></ li > < div style = "clear:both" ></ div > </ ul > </ li > < li > < a href = "#" class = "tool" title = "食器類" >Tableware</ a > < ul class = "drop_down" > < li class = "chill" title = "紙皿" >< a href = "#" >Paper Plates</ a ></ li > < li class = "chill" title = "紙コップ" >< a href = "#" >Paper cups</ a ></ li > < li class = "chill" title = "ストロー" >< a href = "#" >Paper Straws</ a ></ li > < li class = "chill" title = "カトラリー" >< a href = "#" >Wooden Cutlery</ a ></ li > < li class = "chill" title = "ケーキスタンド" >< a href = "#" >Cake Stands</ a ></ li > < li class = "chill" title = "メイソンジャー" >< a href = "#" >Mason Jar</ a ></ li > < div style = "clear:both" ></ div > </ ul > </ li > </ ul > </ div > |
jquery.mouseinfobox.cssで色替え
スクリプトで場所替え
demoで使用のサンプル
★追加CSSのみで—————————————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | < div class = "main_menu" > < ul > < li > < a href = "http://shopping.geocities.jp/borderless-select/" >Top< div class = "toolbox" >< div class = "tool" >トップへ</ div ></ div ></ a > </ li > < li > < a href = "http://store.shopping.yahoo.co.jp/borderless-select/decoration.html" >Decoration< div class = "toolbox" >< div class = "tool" >デコレーション</ div ></ div ></ a > < ul class = "drop_down" > < li class = "chill" >< a href = "http://store.shopping.yahoo.co.jp/borderless-select/pompoms.html" >Pom Poms< div class = "toolbox" >< div class = "tool2" >ペーパーポンポン</ div ></ div ></ a ></ li > < li class = "chill" >< a href = "http://store.shopping.yahoo.co.jp/borderless-select/paperlante.html" >Paper lantern< div class = "toolbox" >< div class = "tool2" >ペーパーランタン</ div ></ div ></ a ></ li > < li class = "chill" >< a href = "http://store.shopping.yahoo.co.jp/borderless-select/garlands.html" >Garlands< div class = "toolbox" >< div class = "tool2" >ガーランド</ div ></ div ></ a ></ li > < div style = "clear:both" ></ div > </ ul > </ li > </ ul ></ div > |
css
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | .main_menu { float : left ; } .main_menu a{ display : block ; } . block { display : block ;} .main_menu ul{ margin-top : 10px ; margin-bottom : 20px ; } .main_menu ul li{ color : #FFFFFF ; font-size : 12px ; float : left ; list-style-type : none ; margin-right : 5px ; margin-left : 5px ; background-color : #fb87e6 ; padding-right : 16px ; padding-left : 16px ; padding-top : 3px ; padding-bottom : 3px ; border-radius : 15px ; -webkit- border-radius : 15px ; -moz- border-radius : 15px ; position : relative ; display : block ; overflow : visible ; } .main_menu ul li a{ color : #FFFFFF !important ; } .main_menu ul li a:hover{ text-decoration : none ; } /*cssでツールチップ*/ /*メインメニューツールチップ*/ .tool{ position : absolute ; z-index : 1111111111 ; top : -36px ; color : #FFF ; border-radius : 5px ; -webkit- border-radius : 5px ; -moz- border-radius : 5px ; background-color : #02C0BB ; font-size : 12px ; padding-top : 5px ; padding-right : 10px ; padding-bottom : 5px ; padding-left : 10px ; display : none ; left : -10px ; } .main_menu ul li a:hover .tool{ display : block ; } /*ドロップダウンツールチップ*/ .tool 2 { position : absolute ; z-index : 1111111111 ; color : #FFF ; border-radius : 5px ; -webkit- border-radius : 5px ; -moz- border-radius : 5px ; background-color : #02C0BB ; font-size : 12px ; padding-top : 5px ; padding-right : 10px ; padding-bottom : 5px ; padding-left : 10px ; display : none ; left : 100px ; top : 0px ; } .main_menu ul li a:hover .tool 2 { display : block ;} /*こいつでくくることで幅にあったツールチップ*/ .toolbox{ width : 400px ; position : absolute ; top : 0px ; } /*カテゴリツールチップ*/ .tool 3 { position : absolute ; z-index : 1111111111 ; color : #FFF ; border-radius : 5px ; -webkit- border-radius : 5px ; -moz- border-radius : 5px ; background-color : #02C0BB ; font-size : 12px ; padding-top : 5px ; padding-right : 10px ; padding-bottom : 5px ; padding-left : 10px ; display : none ; top : 15px ; right : 15px ; } .cate_box:hover .tool 3 { display : block ;} .drop_down{ z-index : 10000 ; overflow : visible !important ; position : absolute ; float : left ; left : 0px ; top : 24px ; margin : 0px !important ; background-color : #FFF ; width : 100% ; padding-top : 0px ; padding-right : 10px ; padding-bottom : 0px ; padding-left : 10px ; border-right-width : 1px ; border-left-width : 1px ; border-right-style : solid ; border-left-style : solid ; border-right-color : #1FBBAF ; border-left-color : #1FBBAF ; border-bottom-width : 1px ; border-bottom-style : solid ; border-bottom-color : #1FBBAF ; border-top-color : #1FBBAF ; } .drop_down li.chill{ color : #888888 ; background-color : #FFF ; width : 100% ; margin : 0px ; padding-top : 5px ; padding-right : 0px ; padding-bottom : 5px ; padding-left : 0px ; } .drop_down li.chill a{ color : #888888 !important ; text-align : left ; display : block ; } .drop_down li:hover{ } .drop_down{ /*ここで隠し*/ display : none ; !important ; /*ここで隠し*/ } /*ここでみせる*/ .main_menu ul li:hover .drop_down{ display : inline ; } /*ここでみせる*/ |