简体   繁体   English

点击链接后,触发网页

[英]On click the Link , trigger a web page

this is a part of a slider code. 这是滑块代码的一部分。

how to change this code to open a page link, not a lightbox of prettyphoto. 如何更改此代码以打开页面链接,而不是prettyphoto的灯箱。

if (typeof this.options.map[middle].link_url != 'undefined') {
                this.$prettyPhoto_a.attr('href', this.options.map[middle].link_url);
            } else {
                this.attr('href', '');
            }

use window.location.href if you are redirecting the page 如果要重定向页面,请使用window.location.href

        (typeof this.options.map[middle].link_url != 'undefined') {
            window.location.href = this.options.map[middle].link_url;
        } else {
            this.attr('href', '');
        }

OR 要么

use window.open(url,'_blank') if you want to open a tab with that url 如果要打开带有该URL的选项卡,请使用window.open(url,'_blank')

        (typeof this.options.map[middle].link_url != 'undefined') {
            window.open(this.options.map[middle].link_url,'_blank');
        } else {
            this.attr('href', '');
        }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM