[英]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');
});
但什么都沒發生。 預先謝謝你們。
試試這個代碼
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.