anchor

Google Analytics and hash/anchor doesn't work

旧街凉风 提交于 2019-12-11 03:37:38
问题 I hope you can help me. I have a gallery in Javascript. Each picture has a specific hash. www.example.com/gallery.html#title_1 My stats are on Google Analytics but hash doesn't exist even when I tried this in the respective code : _gaq.push(['_trackPageview', location.pathname + location.search + location.hash]); or this : _gaq.push(['_setAllowAnchor', true]); Any idea to solve this problem ? Thanks for your answers. 回答1: _setAllowAnchor is for a completely different use case. The right way

Using MATLAB to parse HTML for URL in anchors, help fast

丶灬走出姿态 提交于 2019-12-11 03:34:16
问题 I'm on a strict time limit and I really need a regex to parse this type of anchor (they're all in this format) <a href="20120620_0512_c2_1024.jpg">20120620_0512_c2_102..></a> for the URL 20120620_0512_c2_1024.jpg I know its not a full URL, it's relative, please help Here's my code so far year = datestr(now,'yyyy'); timestamp = datestr(now,'yyyymmdd'); html = urlread(['http://sohowww.nascom.nasa.gov//data/REPROCESSING/Completed/' year '/c2/' timestamp '/']); links = regexprep(html, '<a href=.*

Recognizing http links and creating anchor tags

女生的网名这么多〃 提交于 2019-12-11 03:24:36
问题 I'm trying to parse some string and it has some http links embedded in it. I'd like to dynamically create anchor tags within this string using jquery then display them on the front end so the user can click them. Is there a way to do this? Thanks! 回答1: You can do it like this: $(function(){ //get the string var str = $("#text").html(); //create good link matching regexp var regex = /(https?:\/\/([-\w\.]+)+(:\d+)?(\/([\w\/_\.]*(\?\S+)?)?)?)/g // $1 is the found URL in the text // str.replace

disable anchor tag using Jquery

纵饮孤独 提交于 2019-12-11 03:24:18
问题 I have a image associated with the anchor tag, once the user clicks the image a popup loads. I want to disable this anchor tag. The html code looks like: <a href="#" class="openModalLink"> <img style="vertical-align: middle; border: none" width="9%" alt="" id="imgmap" class="zoom" /></a> I have tried the below codes but doesn't seem to work $(".openModalLink").off("click"); $(".openModalLink").attr("disabled", true); $(".openModalLink").attr("disabled", "disabled"); Thanks for the replies 回答1

Anchor from another page not working in Firefox and IE (works in Chrome)

泄露秘密 提交于 2019-12-11 03:14:27
问题 I've inherited a site with a problem that's driving me nuts in Firefox and IE. There are 3 anchor tags on the site's home page. All of these anchor tags work when the visitor is on the home page, but only 2 of them work when used from other pages. The site is http://sm.retriogroup.com Clicking on "Menus," "Locations" or "Contact" in the header menu brings the page to the right anchor. If you visit another page such as http://sm.retriogroup.com/gallery and then use the same links, only the

Is there way to scroll to anchor rather than jump with javascript (something like smooth scroll)

我怕爱的太早我们不能终老 提交于 2019-12-11 03:14:02
问题 I have a large document with numbered anchor tags as shown below. And a textbox to punch the numbers in to go to anchor which uses window.location.hash I am also using arrow keys to go next or previous anchors. I want to scroll to the anchor so to give some sense of direction. <a name="1"> some text <a name="2"> some text <a name="3"> here is my function function updatePageNumber() { var pagenumber; pagenumber = document.getElementById('pageNumber').value; window.location.hash = pagenumber; }

Unclickable anchor tag

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 03:09:06
问题 I use this html code <div class="titleIn"> <h2><a href="/link2">link2</a></h2> </div> and for some reason the link2 is not clickable (no hand cursor) The CSS is: .titleIn { direction: rtl; margin-bottom: 10px; margin-right: 0; margin-top: -10px; position: relative; text-align: right; z-index: -1; } Any idea? 回答1: I can't say I know why , but I know what's causing it: Your z-index: -1 . If you remove that, the problem goes away (at least, it does for me on Chrome, Firefox, and Opera; not on

How to use # sign as an anchor while url rewriting with .htaccess on apache?

北战南征 提交于 2019-12-11 02:55:31
问题 i have .htaccess that works fine with shorty rewriting rules like RewriteRule ^blog/(.+)$ blog_post.php?blogSEOBaslik=$1 [L] But there is a page about.php which includes subnavigation via <li><a href="#resume"> named anchor. When i apply a rule like: RewriteRule ^about/(.+)$ about.php\#$1 [L] not behave as usual, standart about.php#resume anchor do. How do i use named anchors in url rewriting rules? 回答1: Use NE flag for not encoding the resulting URL: RewriteEngine On RewriteBase /BAH/

Anchors to pages with Masonry layouts

狂风中的少年 提交于 2019-12-11 02:52:18
问题 Since I first posted this issue, I have decided upon an approach but either it is just plain wrong or improperly implemented. ISSUE I have several pages containing div content and using jQuery Masonry for the layout. These pages have cross referencing links via anchors pages. E.g the fifth content div on page A links to an anchor on the ninth div on page B. The issue is the anchor positions don't properly exist until Masonry finishes - i.e. the anchors work fine with Masonry turned off, but

Load page directly to anchor tag

假如想象 提交于 2019-12-11 00:42:26
问题 When I load a page with a hash tag in the URL, the page loads and then jumps to the anchor tag. Is there any way to prevent this "jump", either by loading the page directly to the anchor tag or at least making the scrolling smooth? I see this problem in Chrome and Firefox, but not IE. 回答1: If you're still experiencing the jumping issue, you could something with jQuery: //Use a RegEx pattern to search for an id, if present var pattern = new RegExp('\#(.*)'); var id = pattern.exec(window