• I want to love this because it is the only plugin I’ve been able to find that does just this one thing, have a simple image rollover without a bazillion effects. But….

    Something isn’t closed off with the shortcode. All the rest of the page/post below the image is treated as part of the rollover area.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter rbrbrts

    (@rbrbrts)

    Okay, fixing this is not hard. In image-switcher.php, there are two closing tags missing in the function shortcode_callback_image_switcher.

    
    $force_height= (null != $force_height) ? $force_height : 'inherit';
    	echo '<div style="height:'.$force_height.';" class="img_switch_wrap">
    <a href="'.$link.'">
    <img class="img_switch_image" src="'.$url.'" alt="" style="height:'.$force_height.';">
    <img class="img_switch_image" src="'.$alt_url.'" alt="" style="height:'.$force_height.';">
    </a></div>
    ';
    

    I’ve tightened up a bit of whitespace there, but the main thing is that last line with the closing a and div tags. Add those and this problem goes away.

    Thread Starter rbrbrts

    (@rbrbrts)

    Actually, that’s not correct; it works for my case, but looking a bit closer at the code those lines should not go there. They should go after the next “if” block which is checking for the various alt text/headings. There is an assumption that you will provide at least one of those. If you don’t then you end up with no closing a or div. So right after this

    
    if (!empty($text) || !empty($alt_text) || !empty($alt_heading) || !empty($heading)):
    ...
    endif;
    

    you need to add

    
    echo '</a></div>';
    
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Whole page/post past image is part of rollover trigger’ is closed to new replies.