jquery - How to create tab into a link -


i have following html:

<div class="captionbottom">     <a href="mp.aspx" title=""><img src="c.jpg" alt="" /></a>     <figcaption>view!</figcaption> </div> 

the figcaption shown on image when hovered.

how can make link href of anchor tag, clicking on figcaption takes user mp.aspx

css:

figcaption {     width: 100%;     position: absolute;     background: #e55302;     background: rgba(229,83,2,0.90);     color: #fff;     padding: 10px 0;     opacity: 0;     -webkit-transition: 0.6s ease;     -moz-transition: 0.6s ease;     -o-transition: 0.6s ease;     cursor: pointer; } .captionbottom:hover figcaption {   opacity: 1;   cursor: pointer; } 

using jquery:

$('figcaption').on('click',function() {     var fighref = $(this).prev().attr('href');     window.location.href = fighref; //changed code. }); 

Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -