3

How to make the image hover between the 2 uploaded image?

<div class="portfolio_area_left">
    <a href="<?php if (!empty($node->field_link_site)) print $node->field_link_site['und'][0]['value']; ?>" target="_blank">
        <?php print theme('image_style', array('path' => $imageone, 'style_name' => 'image_800x600', 'attributes'=>array('alt'=>$title))) ?>
    </a>
</div>

The script above just make the node display one image.

The second image is not appearing.

How to make it the image change to the 2nd image if mouse move over the image?

enter image description here

  • I don't think you can with php, you'll need to use css and jQuery. – No Sssweat Oct 28 '16 at 1:58
4

Display both images independently with something like this:

<div class="portfolio_area_left">
    <?php print theme('image_style', array('path' => $imageone, 'style_name' => 'image_800x600', 'attributes'=>array('alt'=>$title))) ?>
    <?php print theme('image_style', array('path' => $two, 'style_name' => 'image_800x600', 'attributes'=>array('alt'=>$title))) ?>
</div>

Then use jQuery for the hover/fade: http://jsfiddle.net/adeneo/xTw44/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.