簡體   English   中英

jQuery為彈出窗口制造商打開自定義模式鏈接而不是主題標簽

[英]Jquery open a custom modal link instead of hashtag for popup maker

我正在嘗試在用戶單擊模式時打開模式。 我目前正在使用彈出式窗口制作工具。

恩。 www.hello.com/test

/ test將是模式鏈接的#變量。

<a href="#test" class="hello"> Im a hidden modal in a link menu</a>

我嘗試閱讀彈出式窗口制造商的文檔,而我需要這樣做。

<a href="#popmake-123" class="hello"> Im a hidden modal in a link menu</a>

但是,當我嘗試輸入這樣的鏈接“ www.hello.com/#popmake-123”時,沒有自動模式顯示。

到目前為止,我嘗試使用這些代碼。

$(window.location.hash).modal('show');
$('a.popmake-user-login').click(function(){
    window.location.hash = $(this).attr('href');
});

但什么都沒發生。 預先謝謝你們。

(鏈接源) Bootstrap 3.x:單擊模式觸發器后如何更改url?

試試這個代碼

jQuery(document).ready(function(){
   jQuery(window.location.hash).modal('show');
   jQuery('a.popmake-user-login').click(function(){
      window.location.hash = jQuery(this).attr('href');
    });
});

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM