【问题标题】:Jquery Cycle - how to create link from anchorJquery Cycle - 如何从锚点创建链接
【发布时间】:2011-12-29 18:15:45
【问题描述】:

我正在使用这个 Jquery:

$('#<%=ModuleControl.ModuleContext.ModuleId%>_Rotator div.DNNModuleContent > div.Normal').after('<ul class="RotatorNav">').cycle({
        fx: 'fade', //effect to apply to rotation
        speed: 1000, // speed of the transition (any valid fx speed value) 
        timeout: 5000, // milliseconds between slide transitions (0 to disable auto advance)
        pager: '#<%=ModuleControl.ModuleContext.ModuleId%>_Rotator .RotatorNav', //selector for rotator navigation
        allowPagerClickBubble: true,
        // callback fn that creates a navigation to use as pager anchor 
        pagerAnchorBuilder: function(idx, slide) {
            return '<li><a href="#">' + slide.title + '</a></li>';
        }
    });

在我的横幅容器中,我使用这两行来指定横幅和锚文本:

<a title="Twitter" target="_self" href="/Twitter/tabid/86/Default.aspx" re_target="_self">
   <img alt="" src="/portals/0/Images/positie1/header-twitter.png" />
</a>

现在我希望在单击锚点时有一个指向特定网页的超链接,而不是在单击时转到该特定横幅。

我认为它应该在 HTML 行中,但我不是那么好,抱歉。有人帮忙吗?

【问题讨论】:

    标签: jquery cycle jquery-cycle


    【解决方案1】:

    一个锚标签是一个链接只需在href属性中指定url。

    【讨论】:

    • 感谢您的快速回复。你能给我一个例子吗,因为我尝试添加一个 href。
    【解决方案2】:

    尝试删除:

        pagerAnchorBuilder: function(idx, slide) {
            return '<li><a href="#">' + slide.title + '</a></li>';
        }
    

    【讨论】:

    • 抱歉,这不起作用。它显示为链接,但没有任何操作。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-11
    • 1970-01-01
    • 2022-06-19
    • 2019-12-12
    • 2020-03-02
    • 1970-01-01
    相关资源
    最近更新 更多