html - Image map change image on hover -


i have problem , love help! website have interactive header. made image map character on header when clicked redirects page.

i switch image when hovers on image map. reading discovered change class b when hovering class sibling markers ~ or + tried these respectively didn't work.

here html concerning header image , image map.

    <div class="td-main-content-wrap td-main-page-wrap">             <div class="td-container">                 <div class="vc_row wpb_row td-pb-row"><div class="wpb_column vc_column_container td-pb-span12"><div class="wpb_wrapper"> <div class="wpb_raw_code wpb_content_element wpb_raw_html">     <div class="wpb_wrapper">         <a href="http://breakline.nl/about/meet-giovanni-boerstra/" class="giomap" title="meet gio!" style="position: absolute; left: 70.63%; top: 20.32%; width: 13.85%; height: 39.57%; z-index: 2;"></a><a href="http://breakline.nl/about/meet-stef-verkooijen/" class="stefmap" title="meet stef!" style="position: absolute; left: 17.6%; top: 44.28%; width: 14.38%; height: 50.74%; z-index: 2;"></a>     </div> </div>  <div class="wpb_single_image wpb_content_element vc_align_center   superheroheader">      <figure class="wpb_wrapper vc_figure">         <div class="vc_single_image-wrapper   vc_box_border_grey"><img width="1920" height="743" src="http://breakline.nl/wp-content/uploads/2016/07/testheadersuperhero2.jpg" class="vc_single_image-img attachment-full" alt="testheadersuperhero2" srcset="http://breakline.nl/wp-content/uploads/2016/07/testheadersuperhero2.jpg 1920w, http://breakline.nl/wp-content/uploads/2016/07/testheadersuperhero2-300x116.jpg 300w, http://breakline.nl/wp-content/uploads/2016/07/testheadersuperhero2-768x297.jpg 768w, http://breakline.nl/wp-content/uploads/2016/07/testheadersuperhero2-1024x396.jpg 1024w, http://breakline.nl/wp-content/uploads/2016/07/testheadersuperhero2-696x269.jpg 696w, http://breakline.nl/wp-content/uploads/2016/07/testheadersuperhero2-1068x413.jpg 1068w, http://breakline.nl/wp-content/uploads/2016/07/testheadersuperhero2-1085x420.jpg 1085w" sizes="(max-width: 1920px) 100vw, 1920px"></div>     </figure> </div> 

and css tried imageswap + thought it.

    .stefmap:hover + .superheroheader img{ visibility:hidden;}     .stefmap:hover + .superheroheader { background-image:url(wp-content/uploads/2016/08/testheadersuperhero2hover.jpg); background-size:cover;} 

you might wanna have @ website if unclear. , check out superman character in header.

you're on right track. reason sibling selector "+" isn't working because you're targeting div not sibling.

so you're doing this:

<div class="wpb_raw_code wpb_content_element wpb_raw_html">     <div class="wpb_wrapper">         <a class="giomap""></a>         <!-- target hover-->         <a class="stefmap""></a>     </div> </div>  <!-- target image change--> <div class="wpb_single_image wpb_content_element vc_align_center   superheroheader"> </div> 

in order css work, need change html target hover on same line target image change (therefore making them siblings). i've tested moving below using browser inspector , doesn't seem mess layout, possible may need rejig rest of header css accommodate change.

<div class="wpb_raw_code wpb_content_element wpb_raw_html">     <div class="wpb_wrapper">         <a class="giomap""></a>     </div>  </div>   <!-- target hover-->  <a class="stefmap""></a>   <!-- target image change-->  <div class="wpb_single_image wpb_content_element vc_align_center   superheroheader">  </div> 

Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -