Jquery Cycle - 如何从锚点创建链接

发布于 2024-12-23 03:28:36 字数 1142 浏览 4 评论 0原文

我正在使用这个 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 行中的内容,但我不太擅长,抱歉。有人帮忙吗?

I'm using this 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>';
        }
    });

And in my bannercontainer I'm using this two lines for specifying the banner and the anchor text:

<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>

Now I want to have a hyperlink to a specific webpage when clicking the anchor instead of going to that specific banner when clicking.

I think it should be something in the HTML line but I'm not that good, sorry. Someone any help?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

半寸时光 2024-12-30 03:28:36

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

An anchor tag is a link just specify the url in the href attribute.

左耳近心 2024-12-30 03:28:36

尝试删除:

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

try remove:

    pagerAnchorBuilder: function(idx, slide) {
        return '<li><a href="#">' + slide.title + '</a></li>';
    }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文