douhuxi4145 2013-12-30 16:56
浏览 15

如何将[幻灯片]图像用作链接

I'm having an issue using images from a Slideshow as links.

This is my code:

<div class="slider-wrapper theme-default sl-2">
    <div id="slider-2" class="nivoSlider-2" >
    <?php foreach ($items as $key=>$item):  ?>
        <?php if($params->get('itemImage') && isset($item->image)): ?>

            <a class="moduleItemTitle" href="<?php echo $item->link; ?>">
                <img src="<?php echo $path1;?>?src=<?php echo $item->image;?>&w=635&h=386&zc=1&q=100" alt="<?php echo K2HelperUtilities::cleanHtml($item->title); ?>" title="#htmlcaption<?php echo $key;?>"/>
            </a>

        <?php endif; ?>
    <?php endforeach; ?>
    </div>
    <?php foreach ($items as $key=>$item):  ?>
    <div id="htmlcaption<?php echo $key;?>" class="nivo-html-caption">
    <?php if($params->get('itemTitle')): ?>
        <!--<h2><a class="moduleItemTitle" href="<?php echo $item->link; ?>"><?php echo $item->title; ?></a></h2>-->
    <?php endif; ?>
    <div class="clr"></div>
        <?php if($params->get('itemIntroText')): ?>
        <div class="description-slider2">
            <p><?php echo $item->introtext; ?></p>
        </div>
    <?php endif; ?> 
    </div>
    <?php endforeach; ?>
</div>

I pass through the "a" tag the $item->link parameter which returns these two strings since the slideshow only contains two images:

string(51) /demo-catarroja2/es/campanas/cavi-catarroja-virtual

&

string(49) /demo-catarroja2/es/campanas/plan-de-ayuda-social

If I inspect the element with a web browser it shows this:

<a class="moduleItemTitle" href="/demo-catarroja2/es/campanas/plan-de-ayuda-social">
    <img src="http://complusoft.net/demo-catarroja2/templates/onews/html/thumb.php?src=/demo-catarroja2/media/k2/items/cache/9c2fe6cb8c357cf6d57c8926869c1003_XL.jpg&w=635&h=386&zc=1&q=100" alt="Plan de Ayuda social 2013" title="#htmlcaption1"/>
</a>

This image is obviously inside the a tag but its acting as a link, why could this be?

You can check out the site here: The slideshow is on the main page up top.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 目详情-五一模拟赛详情页
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
    • ¥15 关于#Java#的问题,如何解决?
    • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
    • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
    • ¥15 cmd cl 0x000007b
    • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line