[問題] 如何用網址指向彈出式視窗

看板Web_Design作者時間9年前 (2015/12/27 13:49), 9年前編輯推噓1(109)
留言10則, 4人參與, 最新討論串1/1
各位先進大家好 小弟最近在接公司網頁時有一些疑問 問題如下 1.後端工程師問我要如何用網址指出 彈出式視窗的頁面 原本寫的是 <li><span>2015-04-13</span ><a href="http://www.xxx.com.tw/media.aspx#" class="overlay" rel="#event6"> </a></li> 我發現前一個人這樣寫 <script> // Overlay $("a.overlay[rel]").overlay({ top: 0, mask: { color: '#000', loadSpeed: 200, opacity: 0.8 }, fixed: true, onLoad: function () { var t = $.mask; if (!t.isLoaded()) { t.load(); var ov = this.getOverlay(); ov.css('z-index', '9999'); } } }); //$("div.bin-main").bind("click", function () { // console.log($(this).find("a").html()); // $(this).find("a").click(); // return; //}); function divClick(e) { if ($(e).find("a").attr('href') != "#") { window.open($(e).find("a").attr('href')); return; } $(e).find("a").click(); } // Scrollto $(function () { $('#subnav a[href*=#]:not([href=#])').click(function () { if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top }, 1000); return false; } } }); }) </script> 所以點了之後視窗彈出但網址不變 那麼我可以用什麼樣的方式直接指向彈出式視窗打開後的頁面呢? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.37.92.38 ※ 文章網址: https://www.ptt.cc/bbs/Web_Design/M.1451195395.A.FC1.html

12/27 17:26, , 1F
看不懂你的問題的意思?
12/27 17:26, 1F
※ 編輯: wen09210 (114.37.92.38), 12/27/2015 17:29:27

12/27 17:31, , 2F
其實我想問的只是有辦法用網址直接指出popup 的視窗嗎,
12/27 17:31, 2F

12/27 17:31, , 3F
像用錨點那樣
12/27 17:31, 3F

12/28 01:30, , 4F
直接指向是什麼意思
12/28 01:30, 4F

12/28 13:32, , 5F
如何用網址直接導入已彈出的視窗
12/28 13:32, 5F

12/28 19:41, , 6F
你是希望這樣子嗎:
12/28 19:41, 6F

12/28 19:42, , 7F
有<a>的那個頁面,假設是 test.com/abc/
12/28 19:42, 7F

12/28 19:42, , 8F
那使用 test.com/abc/#popup1 之類的錨點
12/28 19:42, 8F

12/28 19:42, , 9F
就變成一連直接彈出 popup?
12/28 19:42, 9F

12/28 19:43, , 10F
如果是的話,找找 location.hash 吧
12/28 19:43, 10F
文章代碼(AID): #1MVtm3_1 (Web_Design)
文章代碼(AID): #1MVtm3_1 (Web_Design)