2017-03-14 7 views
1

右のメニューにホバー効果があるコードが含まれています。また私はリンクを持ついくつかのコンテンツを持っています。しかし、そのリンクはメニューのためにクリック可能ではありません。メニューによってリンクがクリックできない

.menubar{position: fixed;right:0;top: 50%;transform: translateY(-50%);-webkit-transform: translateY(-50%);-o-transform: translateY(-50%);-moz-transform: translateY(-50%);overflow: hidden;z-index: 1;} 
 
    .menu{width: auto;height: 40px;line-height: 40px;padding: 0 15px;transform: translateX(85%);-webkit-transform: translateX(85%);-o-transform: translateX(85%);-moz-transform: translateX(85%);transition: all 0.5s ease;margin: 10px auto;border-radius: 5px;cursor: pointer;} 
 
    .menu a{color: #fff;} 
 
    .menu a:hover{color: #fff;opacity:1;} 
 
    .menu a i{margin-right: 10px;} 
 
    .menu:hover{transform: translateX(0%);-webkit-transform: translateX(0%);-o-transform: translateX(0%);-moz-transform: translateX(0%);} 
 
    .blue-bkg{background: #38488e;} 
 
    .homemenu-blue-bkg{background: #38488e;}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> 
 
    
 
    <div class="menubar hidden-xs"> 
 
    \t <div class="menu homemenu-blue-bkg" data-dept="blue"><a href="#"><i class="icon-home"></i>Home</a></div> 
 
    \t <div class="menu blue-bkg" data-dept="srt"><a href="#"><i class="icon-srt"></i>Share Registry & Transfer</a></div> 
 
    \t <div class="menu blue-bkg" data-dept="payroll"><a href="#"><i class="icon-pp"></i>Payroll Processing</a></div> 
 
    \t <div class="menu blue-bkg" data-dept="trust"><a href="#"><i class="icon-ta"></i>Trust Administration</a></div> 
 
    \t <div class="menu blue-bkg" data-dept="rms"><a href="#"><i class="icon-rms"></i>Record Management Services</a></div> 
 
    \t <div class="menu blue-bkg" data-dept="dsc"><a href="#"><i class="icon-dsc"></i>Digital Signature Certification</a></div> 
 
    \t <div class="menu blue-bkg" data-dept="cfdm"><a href="#"><i class="icon-cfdm"></i>Corporate FD Management</a></div> 
 
    </div> 
 
    <div class="container-fluid"> 
 
    <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12"> 
 
    Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. 
 
    </div> 
 
    <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12"> 
 
    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</p><p>, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived</p><p> not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum Aldus PageMaker including. 
 
    <a href="click here">More</a></p> 
 
    </div> 
 
    </div>

私は、メニューの効果だけでなく、リンクがクリック可能なはずホバーしたいです。どのように私はこれを達成することができます。

+0

#の代わりにリンクを追加してみてください –

答えて

0

それはちょっと微調整。見てみな。必要に応じて、ベンダープレフィックスをtransformに追加することを検討することもできます。

  • は、下部のハイパーリンクのhref属性にclick hereため#を追加しました。
  • 全体を.menubarから85%右に移しました(キャンバスの外)。
  • .menuは、ホバリングしたときに左に85%を翻訳します。

.menubar{position: fixed;right:0;top: 50%;transform: translate(85%,-50%);z-index: 1;} 
 
    .menu{width: auto;height: 40px;line-height: 40px;padding: 0 15px;transition: all 0.5s ease;margin: 10px auto;border-radius: 5px;cursor: pointer;} 
 
    .menu a{color: #fff;} 
 
    .menu a:hover{color: #fff;opacity:1;} 
 
    .menu a i{margin-right: 10px;} 
 
    .menu:hover{transform: translateX(-85%);} 
 
    .blue-bkg{background: #38488e;} 
 
    .homemenu-blue-bkg{background: #38488e;}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> 
 
    
 
    <div class="menubar hidden-xs"> 
 
    \t <div class="menu homemenu-blue-bkg" data-dept="blue"><a href="#"><i class="icon-home"></i>Home</a></div> 
 
    \t <div class="menu blue-bkg" data-dept="srt"><a href="#"><i class="icon-srt"></i>Share Registry & Transfer</a></div> 
 
    \t <div class="menu blue-bkg" data-dept="payroll"><a href="#"><i class="icon-pp"></i>Payroll Processing</a></div> 
 
    \t <div class="menu blue-bkg" data-dept="trust"><a href="#"><i class="icon-ta"></i>Trust Administration</a></div> 
 
    \t <div class="menu blue-bkg" data-dept="rms"><a href="#"><i class="icon-rms"></i>Record Management Services</a></div> 
 
    \t <div class="menu blue-bkg" data-dept="dsc"><a href="#"><i class="icon-dsc"></i>Digital Signature Certification</a></div> 
 
    \t <div class="menu blue-bkg" data-dept="cfdm"><a href="#"><i class="icon-cfdm"></i>Corporate FD Management</a></div> 
 
    </div> 
 
    <div class="container-fluid"> 
 
    <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12"> 
 
    Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. 
 
    </div> 
 
    <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12"> 
 
    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</p><p>, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived</p><p> not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum Aldus PageMaker including. 
 
    <a href="#">More</a></p> 
 
    </div> 
 
    </div>

乾杯!

+0

素晴らしい...その作品! – gt06

+0

クール。それが助けられたら、それを受け入れられた答えとして親切にマークしてください。 –

0

このコードを試してみてください..私はあなただけ正しくタグが閉じられていない持っている、このヘルプの

<a href="http://www.breedeal.com" target="_blank">More</a> 
<a href="javascript:void(0)">More</a> 

を願っていますし、この

a:hover{ color: black; } 
+0

私が言ったように、リンクはクリックできません。 – gt06

0

のようにCSSを追加します。

<p><a href="click here">More</p></a> 

<!-- Should be --> 

<p><a href="click here">More</a></p> 
0

次のようにZインデックスを付け:

要素

<a href="click here" class="text-link">More</a></p> 

にクラスを追加し、あなたがしている場合、それ

.text-link { 
    position: relative; 
    z-index: 1; 
} 
0

にこのマークアップを追加a hrefリンクの代わりにメニュー項目をクリックしようとしています。

はその後

<a href="http://www.google.com" target="_blank" ><div class="menu homemenu-blue-bkg" data-dept="blue"><i class="icon-home"></i>Home</div></a> 

そうでない場合は、単にコンテンツをクリックしてください(株式レジストリ&転送)とあなたのリンクが動作するメニュー項目のdivの外にあなたのアンカータグをラップ

<div class="menu blue-bkg" data-dept="srt"><a href="http://www.google.com" target="_blank"><i class="icon-srt"></i>Share Registry & Transfer</a></div> 

Working Plnkr

関連する問題